int a ,bfloat x,ychar c1,c2scanf ("a=%d b=%d",&a,&b)⼀⼀在键盘如何输入阿scanf (" %f %e",&x,&y)

scanf (" %c %c",&c1,&c2);
2024-12-20 12:54:24
推荐回答(2个)
回答1:

#include
int main()
{
int a ,b;
float x,y;
char c1,c2;
scanf ("%d %d",&a,&b);//在键盘如何输入阿scanf (" %f %f",&x,&y)
printf("a=%d,a=%d\n",a,b);
scanf ("%f %f",&x,&y);//两个值输入时中间要输入空格
printf("x=%f,y=%f\n",x,y);
getchar();//抵消去前面输入的回车字符
scanf ("%c %c",&c1,&c2);//两个值输入时中间要输入空格
printf("c1=%c c2=%c\n",c1,c2);
return 0;
}

回答2:

scanf("a=%d b=%d",&a,&b); //如果你是这样写的话,键盘输入的时候必须跟双引号之内的格式一样的才行,必须输入 a=整数值1 b=整数值2;