java语言程序设计基础篇课后答案第八版

java语言程序设计基础篇课后答案第八版1 1 public class Exercise1 1 public static void main String args System out println welcome to Java System out println Welcome to Computer Science System out

大家好,我是讯享网,很高兴认识大家。



1.1

public class Exercise1_1 {

public static void main(String[] args){

System.out.println("welcome to Java");

System.out.println("Welcome to Computer Science");

System.out.println("Programming is fun");

}

}

1.2

public class Exercise1_2 {java语言程序设计基础篇课后答案第八版

public static void main(String[] args){

for(int i = 0; i 

System.out.println("第"+(i+1)+"个"+"Welcome to Java!");

}

}

1.3

public class Exercise1_3 {

public static void main(String[] args){

System.out.println("    J     A     V     V    A     ");

System.out.println("    J    A A     V   V    A A    ");

System.out.println("J   J   AAAAA     V V    AAAAA   ");

System.out.println(" J J   A     A     V    A     A  ");

}

}

1.4

public class Exercise1_4 {

public static void main(String[] args){

System.out.println("a      a^2      a^3");

System.out.println("1      1        1 ");

System.out.println("2      4        8");

System.out.println("3      9        27");

System.out.println("4      16       64");

}

}

1.5

public class Exercise1_5 {

public static void main(String[] arga){

System.out.println((9.5 * 4.5 - 2.5 * 3) / (45.5 - 3.5));

}

}

Output:0.57143

1.6

public class Exercise1_6 {

public static void main(String[] arga){

System.out.println(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9);

}

}

Output:45

1.7

public class Exercise1_7 {

public static void main(String[] args){

System.out.println(4 * (1 - 1.0 / 3 + 1.0 / 5 - 1.0 /7 + 1.0 / 9 - 1.0 / 11 + 1.0 /13));

}

}

小讯
上一篇 2024-12-31 21:27
下一篇 2024-12-27 17:25

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/10605.html