执行下列程序段的输出结果是 int num=1234,s=0; while(num!=0) {s=s*10+num%10; num=num/10; } printf("%d",s);A.4321B.1234C.4D.10
执行下列程序段的输出结果是 int num=1234,s=0; while(num!=0) {s=s*10+num%10; num=num/10; } printf("%d",s);
A.4321
B.1234
C.4
D.10
参考答案和解析
10 9 8 1098
相关考题:
有以下程序main(){ char *p[]={"3697","2584"};int i,j; long num=0;for(i=0;i2;i++){j=0;while(p[i][j]!='\0'){ if((p[i][j]-'0') % 2)num=10*num+p[i][j]-'0';j+=2;}}printf(" % d\n",num);}程序执行后的输出结果是A)35B)37C)39D)3975
有以下程序:main(){ char *p[]={"3697","2584"}; int i,j; long num=0; for(i=0;i2;i++) {j=0;while(p[i][j]!=’\0’){ if((p[i][j]-’0’)%2= =0)num=10*num+p[i][j]-’0’; j+=2;} } printf("%d\n",num);}程序执行后的输出结果是( )。A.35 B.37C.39 D.28
阅读如下程序段,则执行后程序的输出结果是#includemain(){structa{int x; int y;}num[2]={{20,5},{6,7}};printf("%d\n",num[0].x/num[0].y*num[1].y);}A.0B.28C.20D.5
有以下程序includestruct STU{char name[10];int num;};void f(char*name, intnum){s 有以下程序 #include <string.h> struct STU { char name[10]; int num; }; void f(char *name, int num) { struct STU s[2]={{"SunDan",20044},{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() { struct STU s[2]={{"YangSan",20041},{"LiSiGuo",20042}},*p; p=s[1]; f(p->name,p->num); printf("%s %d\n",p->name,p->num); } 程序运行后的输出结果是A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041
有以下程序 include typedef struct { int num;double s; }REC; void funl(REC *x) { x 有以下程序 include<stdio.h> typedef struct { int num;double s; }REC; void funl(REC *x) { x->num=23;x->s=88.5; } void main() { REC a={16,90.0}; fun1(A); printf("%d\n",a.num); } 程序运行后的输出结果是( )。
有下列程序: main( ) { char*P[]={"3697","2584"); int i,j;long num=0; for(i=0;i2;i++) {j=0; while(p[i][j]!=\0) {if((p[i][j]-t\0)%2)num=10*num+p[j][j]-0; j+=2; } } printf("%d\n",num); } 程序执行后的输出结果是( )。A.35B.37C.39D.3975
有以下程序:include main( ) char * p[ ] = {"3697" ,"2548" }; int i,j;long num =0 有以下程序: #include <stdio.h> main( ) char * p[ ] = {"3697" ,"2548" }; int i,j; long num =0; for(i =0;i<2;i ++ ) { j =0; while(p[i][j]! ='\0') { if((p[i][j]-'0')%2) num=10*num+p[i][j]-'0'; j+ =2; } printf( "%d \n" ,num);}程序执行后的输出结果是( )。A.35B.37C.39D.3975
有以下程序: include struct STU {int num; float TotalScore; 有以下程序: #include <strino.h> struct STU {int num; float TotalScore; }; void f(struct STU p) {struct STU s[2]={{20044,550},{20045,537}}; p.num=s[1].num;p.TotalScore=s[1].TotalScore; } main() {struct STU s[2]={{20041,703},{20042,580}}; f(s[0]); printf("%d%3.0t\n",s[0].num,s[0].TotalScore); } 程序运行后的输出结果是 ______。A.20045 537B.20044 550C.20042 580D.20041 703
有以下程序: include struct STU (char name[10]; int num; }; 有以下程序: #include <string.h> struct STU (char name[10]; int num; }; void f(char *name, int num) {struct STU s[2]={{"SunDan",20044}.{"Penghua",20045}}; num=s[0].num; strcpy(name,s[0].name); } main() {struct STU s[2]={{"YangSall",20041},{"LiSiGao",20042}},*p;p=s[1]; f(p->name,p->num); printf("%s%d\n",p->name,p->num); } 程序运行后的输出结果是 ______。A.SunDan 20042B.SunDan 20044C.LiSiGuo 20042D.YangSan 20041
有以下程序: main() {char*p[]={"3697","2584"}; int i,j;long num=0; for(i=0;i<2;i++) {j=0; while(p[i][j]!='\0') {if((p[i][j]-'0')%2)num=10*num+p[i][j]-'0'; j+=2; } } printf("%d\n",num); } 程序执行后的输出结果是( )。A.35B.37C.39D.3975
以下程序运行后的输出结果是【 】。struct NODE{int num;struct NODE *next;};main(){struct NODE s[3]={{1,'\0'},{2,'\0'},{3,'0'}},*p,*q,*r;int sum=0;s[0].next=s+1;s[1].next=s+2;s[2].next=s;p=s; q=p->next; r=q->next;sum+=q->next->num; sum+=r->next->next->num;printf("%d\n",sum);}
有以下程序#include string.hstruct STU{ int num; float TotalScore; };void f(struct STU p){ struct STU s[2]={{1047,530},{1048,531}}; p.num = s[1].num; p.TotalScore = s[1].TotalScore;}main(){ struct STU s[2]={{2041,730},{2042,731}}; f(s[0]); printf("%d,%3.0f\n",s[0].num,s[0].TotalScore);}程序的运行结果是A.1047,530 B.1048,531C.2041,730 D.2042,731
运行下列程序时,若输入数据为“321”,则输出结果是( )。 main() {int num,i,j,k,s; scanf("%d",num); if(num>99) s=3; else if(num>9) s=2; else s=1; i=num/100; j=(num-i*100)/10; k=(num-i*100-j*10); switch(s) {case 3:printf("%d%d%d\n",k,j,i); break; case 2:printf("%d%d\n",k,j); case 1:printf("%d\n",k); } }A.123B.1,2,3C.321D.3,2,1
以下程序的输出结果是 ______。 main() {int num=0; while(num<=2) {num++;printf("%d\n",num);} }D.1 1 1 1 2 2 2 3 3 4
下列程序段运行结果是______。Dim c As Integer,num As IntegerNum=29483Doc=num Mod 10Print c;num=num\10Loop While num<>0
以下程序的输出结果是______。 main() {int num=0; while(num<=2) { num++; printf("%d\n",num); } }A.1 2 3 4B.1 2 3C.1 2D.1
以下程序的输出结果是( )。main( ){ int num=0;while(num=2){ num++;printf(”%d\n”,num); }}A.1B.1 2 3C.1 2 3 4D.1 2 2 3
请读程序: includemain(){int num=0;while(num 请读程序: # include<stdio.h> main( ) {int num=0; while(num<=2) {num+ +;printf("%d\n",num);} } 上面程序的输出结果是 ( )A.1B.1 2C.1 2 3D.1 2 3 4
单选题有以下程序:#include struct STU{ int num; float TotalScore;};void f(struct STU p){ struct STU s[2] = {{20044,550}, {20045,537}}; p.num = s[1].num; p.TotalScore = s[1].TotalScore;}main(){ struct STU s[2] = {{20041,703}, {20042,580}}; f(s[0]); printf(%d %3.0f, s[0].num, s[0].TotalScore);}程序运行后的输出结果是( )。A20045 537B20044 550C20042 580D20041 703
单选题有如下程序:#include #include struct S{ char name[10];};void change(struct S *data,int value){ strcpy(data-name, ****); value=13;}main(){ struct S input; int num = 4; strcpy(input.name, THIS); change(input,num); printf(%s,%d,input.name,num);}程序运行后的输出结果是( )。A****,4B****,13CTHIS,4DTHIS,13
单选题有以下程序#include #include struct S{ char name[10];};void change(struct S *data, int value){ strcpy(data-name, #); value = 6;}main(){ struct S input; int num = 3; strcpy(input.name, OK); change(input, num); printf(%s,%d, input.name, num);}程序运行后的输出结果是( )。AOK,6B#,6COK,3D#,3