用java循环语句输出one,two,three,four,five
答案:3 悬赏:40 手机版
解决时间 2021-01-09 03:38
- 提问者网友:書生途
- 2021-01-08 14:28
用java循环语句输出one,two,three,four,five
最佳答案
- 五星知识达人网友:一秋
- 2021-01-08 15:35
String[] strArr={"one","two","three","four"};
for(int a=0;a System.out.println(strArr[a]);
}
for(int a=0;a
}
全部回答
- 1楼网友:往事隔山水
- 2021-01-08 17:22
定义一个string类型数组,把这几个字符串放进去之后,用for循环输出。
String[] str = new String[]{"one","two","three","four","five"};
for(int i=0;i system.out.print(str[i]+" ");
}
String[] str = new String[]{"one","two","three","four","five"};
for(int i=0;i
}
- 2楼网友:猎心人
- 2021-01-08 16:43
public class PrintTest{
static final String[] str = {"one","two","three","four","five"};
public static void main(String[] args){
for(int i=0; i < str.length; i++){
System.out.print(str[i]);
if (i< str.length-1 ){
System.out.print(",");
}
}
System.out.println();
}
}
static final String[] str = {"one","two","three","four","five"};
public static void main(String[] args){
for(int i=0; i < str.length; i++){
System.out.print(str[i]);
if (i< str.length-1 ){
System.out.print(",");
}
}
System.out.println();
}
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯