题目内容

以下程序的运行结果是____。#include main(){int i,j,k;for (i=1;i<=6;i++){for (j=1;j<=20-2*i;j++)printf(" ");for (k=1;k<=i;k++)printf("%4d",i);printf("\n");}}

查看答案
更多问题

以下程序的运行结果是____。#include main(){int i,j,k;for (i=1;i<=6;i++){for (j=1;j<=20-3*i;j++)printf(" ");for (k=1;k<=i;k++)printf("%3d",k);for (k=i-1;k>0;k--)printf("%3d",k);printf("\n");}}

以下程序的运行结果是____。#include main(){int i,j,k;for (i=1;i<=4;i++){for (j=1;j<=20-3*i;j++)printf(" ");for (k=1;k<=2*i-1;k++)printf("%3s","*");printf("\n");}for (i=3;i>0;i--){for (j=1;j<=20-3*i;j++)printf(" ");for (k=1;k<=2*i-1;k++)printf("%3s","*");printf("\n");}}

下列语句段中不是死循环的是____。

A. i=100;while (1) { i=i%100+1; if (i==20) break; }
B. for (i=1;;i++) sum=sum+1;
C. k=0; do { ++k; } while (k<=0);
D. s=3379;while (s++%2+3%2)s++

以下程序的输出结果是____。#include main(){int i;for (i=4;i<=10;i++){if (i%3==0) continue;printf("%d",i);}}

A. 45
B. 457810
C. 69
D. 678910

答案查题题库