#include<stdio.h>
int main(void)
{
char a, b, c;
printf("输入三个字符:");
scanf_s("%c,%c,%c\n", &a,&b,&c);
printf("a=%c\n",a);
printf("b=%c\n",b);
printf("c=%c\n",c);
return 0;
}
#include<stdio.h>
int main(void)
{
char a, b, c;
printf("输入三个字符:");
scanf_s("%c,%c,%c\n", &a,&b,&c);
printf("a=%c\n",a);
printf("b=%c\n",b);
printf("c=%c\n",c);
return 0;
}
你设置的输入格式是逗号分割的,你自己输入的是空格分割