java判断题及答案 java程序设计题目?

java程序设计题目?例如,有以下两种方法可用://output the number of the first n items,int n=20,method 1:int a=1,B=1,对于(in

java程序设计题目?

例如,有以下两种方法可用:

//output the number of the first n items,int n=20,method 1:int a=1,B=1,对于(int i=1i<=ni){R

如果(1==i){R系统打印(i)

}

否则{

a=1

b=2 系统打印(“,”a“/”b)

}

} 系统输出打印()[R

//方法2:[R

for(int i=1 i)<=n i){R

if(1==i){R系统打印(i)

}

否则{ 系统打印(“,”i“/”(2*i-1))

}

} 系统输出打印()