• 2021-04-14
    下列程序的输出结果是 。 main( ) { int a[3][3]={{1,2,9},{3,4,8},{5,6,7}},i,s=0; for(i=0;i<3;i+ +) s+ =a[i][i]+a[i][3-i-1]; printf("%d\n",s); }
  • 30

    内容

    • 0

      有以下程序,运行结果是()。 main() {     int s[12]={1, 2, 3, 4, 4, 3, 2, 1, 1, 1, 2, 3}, c[5]={0}, i;    for(i=0; i<12; i++)        c[s[i]]++;     for(i=1; i<5; i++)        printf("%d", c[i]);    printf("\n"); }

    • 1

      【单选题】下面程序执行后的输出结果是()。#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. 死循环

    • 2

      下列程序的输出结果是 。#includevoid main(){int i=1,s=3;do{s+=i++;if(s%7==0)continue;else++i;}while(s<;15);printf("i=%d\n",i);}

    • 3

      下面程序执行后的输出结果是()。#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: 死循环

    • 4

      有以下程序:main(){inti,s=1;for(i=1;i<50;i++)if(!(i%5)&&!(i%3))s+=i;printf("%d\n",s);}程序的输出结果是().