下列代码的运行结果是:( ) int a = 30; int b = 20; b = a; a = 10; Console.Write(a+","); Console.WriteLine(a / b);
A: 10,0
B: 10,0.5
C: 30,1
D: 30,1.5
A: 10,0
B: 10,0.5
C: 30,1
D: 30,1.5
举一反三
- 在C#中,下列代码的运行结果是__________。[br][/br] int a=30,b=20; b=a; a=10; Console.WriteLine(a); A: 10 10 B: 10 30 C: 30 20 D: 10 20
- 下列代码的运行结果是( )int [ ]age1=new int[ ]{10,20};int[]age2=age1;age2[1]=30;Console.WriteLine(age1[1]); A: 0 B: 10 C: 20 D: 30
- 下列程序的运行结果是 int main (void){ int a, b, c; a=20; b=30; c=10; if (a[b) a=b; if (a]=b) b=c; c=a; printf("a=%d, b=%d, c=%d", a, b, c); return 0; } A: a=20, b=10, c=20 B: a=30, b=10, c=20 C: a=30, b=10, c=30 D: a=30, b=10, c=20
- 在C#中,下列代码的运行结果是()inta=30,b=20;b=a;a=10;Console.WriteLine(a+""+b); A: 1010 B: 1030 C: 1020
- 下列程序片段的输出结果是( )。int a=20,b=30,c=10; if(a<b) a=0; if(a=b) b=c; else c=a; printf("a=%d,b=%d,c=%d",a,b,c); A: a=30,b=10,c=10 B: a=0,b=30,c=0 C: a=0,b=10,c=0 D: a=0,b=30,c=20