填空题

有以下程序   #include <stdio.h>   main( )   { char ch1,ch2; int n1,n2;    ch1=getchar( );    ch2=getchar( );    n1=ch1-‘0’; n2=n1*10+(ch2-‘0’);    printf(“%d\n”,n2);}   程序运行时输入:12<回车>,执行后输出结果是【 】。

【参考答案】

L
<上一题 目录 下一题>
热门 试题

单项选择题
有以下程序:struct STU{ char num[10]; float score[3];};main( ){ struct STU s[3]={{ 20021 ,90,95,85},{ 20022 ,95,80,75},{ 20023 ,100,95,90} },*p=s;int i; float sum=0;for(i=0;i<3;i++)sum=sum+p->score[i];printf( %6.2f n ,sum);}程序运行后的输出结果是( )。
A.260
B.270
C.280
D.285
单项选择题
有下列程序:#include <stdio.h>#include string.h typedef struct{char name[9]; char sex;float score[2];}STU;void f(STU A){ STU b={ Zhao ,’’m’’,85.0,90.0};int i;strcpy(a.name,b.name);a.sex=b.sex;for(i=0;i<2;i++) a.score[i]=b.score[i];}main(){ STU c={ Qian ,’’f’’,95.0,92.0};f(C) ;printf( %s,%c,%2.0f,%2.0f n ,c.name,c.sex,c.score[0],c.score[1]);}程序的运行结果是( )。
A.Qian,f,95,92
B.Qian,m,85,90
C.Zhao,f,95,92
D.Zhao,m, 85,90
相关试题
  • 数据独立性分为逻辑独立性与物理独立性。当...
  • 若有以下程序main( ){ int a=4,b...
  • 以下程序运行后的输出结果是【 】。main(...
  • 下列程序中函数fun的功能是:统计person所...
  • 下列程序的运行结果是:【 】#include ...