中国大学MOOC: 找出1~100内被3或7整除的整数个数。请在_________处填入适当的内容(不要空格!!),完善程序。Dim x%, i%x = 0For i = 1 To 100 If i Mod 3 = 0 Or i Mod 7 = 0 Then x = _________ End IfNextText1.Text = x
举一反三
- 找出1~100内被3或7整除的整数个数。请在________...IfNextText1.Text = x
- 使用数组x输出10个1-100之间的随机整数(包括1和100),下列命令中正确的是:( ) A: Dim x(9) As Integer For i = 1 To UBound(x) x(i) = Int(Rnd() * 100 + 1) Print x(i); Next B: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Rnd(10) Print x(i); Next C: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Int(Rnd() * 100 ) Print x(i); Next D: Dim x(9) As Integer For i = 0 To UBound(x) x(i) = Int(Rnd() * 100 + 1) Print x(i); Next
- 有以下程序 ,其输出结果是 main() { int x,i; for(i=1;i < =50;i++) { x=i; if(x%2==0) if(x%3==0) if(x%7==0) printf("%d",i); } }
- Public Sub Proc(a%( )) Static i% Do a(i) = a(i) + a(i + 1) i = i + 1 Loop While i < 2 End Sub Private Sub Command1_Click( ) Dim m%, i%, x%(10) For i = 0 To 4: x(i) = i + 1: Next i For i = 1 To 2: Call Proc(x): Next i For i = 0 To 4: Print x(i);: Next i End Sub A: 3 4 7 5 6 B: 3 5 7 4 5 C: 2 3 4 4 5 D: 4 5 6 7 8
- 以下程序若运行时输入:246 ,结果是。 main() {int x[3][2]={0},i; for(i=0;i<3;i++) scanf("%d",&x[i]); printf("%3d%3d%3d ",x[0][0],x[0][1],x[1][0]); }