n = 0
For i = 200 To 1000
If i Mod 4 = 3 And i Mod 7 = 5 And i Mod 9 = 2 Then
n = n + 1
End If
Next i
Print n
我对VB不太熟,只能告诉你算法:
int a=0;(记录被4除余3的个数).
int b=0;
int c=0;
FOR (int i=200;i<=1000;i++){
if(i%4==3){
a++;
}
if(i%7==5){
b++;
}
if(i%9==2)
c++;
}
}
输出a(被4除余3的个数),b(被7除余5),c(被9除余2的数的个数)