请问下各位大神,scanf数据输入数据怎么隔开?
#include <stdio.h>int main()
{
int a,b;
float x,y;
char c1,c2;
scanf("a=%db=%d",&a,&b); //输入整型变量a,b
scanf("%f%f",&x,&y); //输入实型变量x,y
scanf("%c%c",&c1,&c2); //输入字符变量c1,c2
printf("a=%d,b=%d,x=&f,y=%e,c1=%c,c2=%c\n",a,b,x,y,c1,c2);
return 0;
}
逗号空格都试过了,总是输出不了想得到的,是不是哪里编错了?