给出程序的运行结果,程序运行时从键盘输入:54321<回车>
#include
intmain()
{
inta,b,s;
scanf("%2d%2d",&a,&b);
s=a/b;
printf("s=%d",s);
return0;
}
#include
intmain()
{
inta,b,s;
scanf("%2d%2d",&a,&b);
s=a/b;
printf("s=%d",s);
return0;
}
举一反三
- 给出程序的运行结果,程序运行时从键盘输入:54321<回车> #include ...=%d",s); return 0; }
- 下面程序的运行结果是:We,s()。 #include intmain() { printf(“%s,%c”, "We",*"students"); return0; }
- 以下程序运行结果()。#includeintf(inta){returna%2;}intmain(){ints[8]={1,3,5,2,4,6},i,d=0;for(i=0;f(s[i]);i++)d+=s[i];printf("%d\n",d);}
- 中国大学MOOC: 若在程序运行时,输入:4 3,则执行下面程序输出的结果是( )。#include <stdio.h>int main(){ int a,b,s; scanf("%d%d",&a,&b); s=a; if(a>b) s=b; s=s*s; printf("%d\n", s); return 0;}
- 下面程序的运行结果是()。#includeintmain(){inta,s,n,count;a=2;s=0;n=1;count=1;while(count<=7){n=n*a;s=s+n;++count;}printf(“%d”,s);return0;}