下述程序段中,与其他3个程序段作用不同的是_______。 A: s=0 i=0 While i>100 s=s+1 Wend B: s=0 i=0 While i<100 i=i+1 Wend C: s=0 i=1 Do While i<100 s=s+1 i=i+1 Loop D: s=0 i=0 Do Until i>=100 s=s+1 i=i+1 Loop
下述程序段中,与其他3个程序段作用不同的是_______。 A: s=0 i=0 While i>100 s=s+1 Wend B: s=0 i=0 While i<100 i=i+1 Wend C: s=0 i=1 Do While i<100 s=s+1 i=i+1 Loop D: s=0 i=0 Do Until i>=100 s=s+1 i=i+1 Loop
中国大学MOOC: 下面程序执行后的输出结果是( )。#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue;
中国大学MOOC: 下面程序执行后的输出结果是( )。#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue; if (i==6) break; i++; s+=i; }; printf(%d,s); return 0;}#include int main(){ int i=0,s=0; for (;;) { if(i==3||i==5) continue;
若有说明:int a[3][4],s; ,则对数组a的元素引用错误的是____________ 。 A: s=0; for(i=0;i<3;i++) for(j=0;j<4;j++) s+=a[i][j]; B: s=0; for(j=0;j<4;j++) for(i=0;i<3;i++) s+=a[i][j]; C: s=0; for(i=0;i<4;i++) for(j=0;j<3;j++) s+=a[j][i]; D: s=0; for(i=0;i<3;i++) for(j=0;j<4;j++) s+=a[j][i];
若有说明:int a[3][4],s; ,则对数组a的元素引用错误的是____________ 。 A: s=0; for(i=0;i<3;i++) for(j=0;j<4;j++) s+=a[i][j]; B: s=0; for(j=0;j<4;j++) for(i=0;i<3;i++) s+=a[i][j]; C: s=0; for(i=0;i<4;i++) for(j=0;j<3;j++) s+=a[j][i]; D: s=0; for(i=0;i<3;i++) for(j=0;j<4;j++) s+=a[j][i];
下面程序的运行结果是(). void delch(char *s) { int i,j; char *a; a=s; for(i=0,j=0;a[i]!='\0';i++) if(a[i]>='0'&&a[i]<='9') {s[j]=a[i];j++;} s[j]='\0'; } main() { char *item="a34bc"; delch(item); printf("\n%s",item); }
下面程序的运行结果是(). void delch(char *s) { int i,j; char *a; a=s; for(i=0,j=0;a[i]!='\0';i++) if(a[i]>='0'&&a[i]<='9') {s[j]=a[i];j++;} s[j]='\0'; } main() { char *item="a34bc"; delch(item); printf("\n%s",item); }
s=0; for i=0; i<n; i++) for(j=0; j<n; j++) s+=B[i][j]; sum=s;[/i]
s=0; for i=0; i<n; i++) for(j=0; j<n; j++) s+=B[i][j]; sum=s;[/i]
【单选题】下面程序执行后的输出结果是()。#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0; A. 10 B. 13 C. 21 D. 死循环
【单选题】下面程序执行后的输出结果是()。#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0;for (;;) {if(i==3||i==5) continue;if (i==6) break;i++; s+=i;};printf("%d",s); return 0;}#include <stdio.h>int main(){int i=0,s=0; A. 10 B. 13 C. 21 D. 死循环
下列程序是求1到100的累计和,其中哪个程序是不能完成功能的: A: int s=0,i=0; while(i<=100)s+=i++ B: int s=0,i=0; while(i++<=100)s+=i; C: int s=0,i=0; while(i<100)s+=++i; D: int s=0,i=0; while(++i<=100)s+=i;
下列程序是求1到100的累计和,其中哪个程序是不能完成功能的: A: int s=0,i=0; while(i<=100)s+=i++ B: int s=0,i=0; while(i++<=100)s+=i; C: int s=0,i=0; while(i<100)s+=++i; D: int s=0,i=0; while(++i<=100)s+=i;
以下程序的输出是 ___。main() {char a[2][5]={”6937”,”8254”}; int i,j,s=0; for ( i = 0; i < 2; i++ ) for ( j = 0; a[i][j]>’0’ && a[i][j]<=’9’; j+=2 ) s=10*s+a[i][j]-’0’; printf(”s=%d\n”,s);}
以下程序的输出是 ___。main() {char a[2][5]={”6937”,”8254”}; int i,j,s=0; for ( i = 0; i < 2; i++ ) for ( j = 0; a[i][j]>’0’ && a[i][j]<=’9’; j+=2 ) s=10*s+a[i][j]-’0’; printf(”s=%d\n”,s);}
下面程序执行后的输出结果是()。#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;} A: 10 B: 13 C: 21 D: 死循环
下面程序执行后的输出结果是()。#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;}#includeintmain(){inti=0,s=0;for(;;){if(i==3||i==5)continue;if(i==6)break;i++;s+=i;};printf("%d",s);return0;} A: 10 B: 13 C: 21 D: 死循环
有如下程序段:s = 0For i = 1 To 10 s = s + iNext iPrint s与上述程序段输出结果相同的程序段为( )。 A: s = 0: i = 0 While i <= 10 i = i + 1 s = s + i Wend Print s B: s = 0: i = 1 While i < 10 i = i + 1 s = s + i Wend Print s C: s = 0: i = 1 Do s = s + i i = i + 1 Loop While i < 10 Print s D: s = 0: i = 1 Do s = s + i i = i + 1 Loop Until i > 10 Print s
有如下程序段:s = 0For i = 1 To 10 s = s + iNext iPrint s与上述程序段输出结果相同的程序段为( )。 A: s = 0: i = 0 While i <= 10 i = i + 1 s = s + i Wend Print s B: s = 0: i = 1 While i < 10 i = i + 1 s = s + i Wend Print s C: s = 0: i = 1 Do s = s + i i = i + 1 Loop While i < 10 Print s D: s = 0: i = 1 Do s = s + i i = i + 1 Loop Until i > 10 Print s