用下面的scanf函数输入数据,使a=3,b=7,x=8.5,y=71.82,c1='A',c2='a'。问在键盘上如何输入?
#include <stdio.h> int main() { int a,b; float x,y; char cl,c2; scanf("a=%db=%d",&a,&b); scanf("%f%e",&a,&y); scanf("%c%c",&c1,&c2); return 0; }
#include <stdio.h> int main( ) {int a,b; float x,y; char c1,c2; scanf("a=%d b=%d",&a,&b); scanf(”%f%e",&x,&y); scanf("%c%c",&c1,&c2); printf("a=%d,b=%d,x=%f,y=%f,c1=%c,c2=%c\n",a,b,x,y,c1,c2); return 0; }
#include <stdio.h>
int main( )
{int a,b;
float x,y;
char c1,c2;
scanf("a=%d b=%d",&a,&b);
scanf(”%f%e",&x,&y);
scanf("%c%c",&c1,&c2);
printf("a=%d,b=%d,x=%f,y=%f,c1=%c,c2=%c\n",a,b,x,y,c1,c2);
return 0;
}
#include <stdio.h> int main() { int a,b; float x,y; char c1,c2; scanf("%d %d ",&a,&b); scanf("%f %e ",&x,&y); scanf("%c %c",&c1,&c2); printf("a=%d,b=%d,x=%0.1f,y=%0.2f,c1=%c,c2=%c",a,b,x,y,c1,c2); return 0; }
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题