求一个JAVA的运行结果!急!!!
来源:百度知道 编辑:UC知道 时间:2024/06/16 22:50:20
以下程序的输出结果是什么?
public class Test2{
public static void main(Strin args[]){
int count=1;
While(coun<+10){
System.out.println(count%2==1?"****":"++++++++")
}
}
}
public class Test2{
public static void main(Strin args[]){
int count=1;
While(coun<+10){
System.out.println(count%2==1?"****":"++++++++")
}
}
}
你的程序好多错误,把String写成Strin,把While(coun<=10)写成While(coun<+10),而且本来是count你非要写成coun,忠告你一句,学软件开发,这么粗心大意肯定不行!一个标点符号错都不行!
public class Test2{
public static void main(String[] args)
{
int count = 1;
while(count++<10){
System.out.println(count%2==1 ? "****": "++++++++");
}
}
}
运行结果是10行,1-10,当数字除2余1就输出****,否则输出++++++++
就是2n+1
++++++++
****
++++++++
****
++++++++
****
++++++++
****
++++++++
错误太多,Strin 是什么? Strin args[]) []是放在String后面
While(coun<+10) While的w只能小写,coun是什么?
不用运行,一看就知道
报错
编译通不过
Strin是什么?
急也没有用 这么多错误 要细心