更多“下面对i值的输出结果说法正确的是() class Program { static void Main(string[] args) { int i=0; do { i++; } while(i<5)…”相关的问题
第1题
下面的代码的执行结果是( ) public class test { private static int j = 0; private static boolean methodB(int k) { j += k; return true; } public static void methodA(int i) { boolean b; b = i < 12 | methodB (5); b = i < 12 || methodB (10); } public static void main (String args[]) { methodA(0); System.out.println(j); } }
点击查看答案
第2题
以下程序运行结果的第一行为________。 for i in range(5,10): if i%3==0: print(i)
点击查看答案
第3题
以下程序的输出结果为( )。 public static void main(String[] args) { for(int i=1;i<5;i++) { if(i%3="=0)" continue; system.out.println(i+ ""); }> A、1 2 4
点击查看答案
第4题
下面程序的运行结果是____ public static void main(String [] args) { int a[][]={{1,2,3},{4,5,6}}; System.out.println(a[1][1]); }
点击查看答案
第5题
class Program { public static void Main(string[] args) { int[] a = new int[3] { 1, 2, 3 }; for (int i = 0; i < 3; i++) Console.Write("{0} ", a[i]); Console.WriteLine(); int[] b = a; for (int i = 0; i < 3; i++) b[i] = 2 * b[i]; for (int i = 0; i < 3; i++) Console.Write("{0} ", a[i]); Console.WriteLine(); Console.Read(); } }
点击查看答案
第6题
写出以下程序的运行结果:public class Test { public int t=4; public static void main(String[] args) { new Test().NumberPlay(); } public void NumberPlay() { int t=2; t = t+5; this.t = this.t-2; t = t-this.t; System.out.println(t+this.t+”ok”); } }
点击查看答案
第7题
using System; namespace aaa { class Program { static void Main() { int i, s=0; for(i=2; i<=6; i++,i++) { s+="i;" } console.writeline("{0}",s); 该程序的输出结果是(> A、9
点击查看答案
第8题
有以下C#程序: using System; namespace aaa { class Program { static void Main() { int i = 0, a = 0; while (i < 20) { for (; ; ) { if (i % 10 == 0) break; else i--; } i += 11; a += i; } Console.WriteLine("{0}", a); } } } 该程序的输出结果是( )。
点击查看答案
第9题
下列代码输出正确的是( ) class Program { static void Main(string[] args) { int i, j; for(i=1; i>=0; i--) for(j=0; j<=i; j++) console.writeline(“i*j="{0}”,i*j);" }> A、i*j=0 i*j=0 i*j=0
B、i*j=1 i*j=0 i*j=1
C、i*j=1 i*j=1 i*j=0
D、i*j=0 i*j=1 i*j=0
点击查看答案