64,267
社区成员
发帖
与我相关
我的任务
分享
printf("%d,%d,%d", &a, &b, &c);
//这样写在输入的时候要输入逗号,是一种对输入格式的限制
//但是写为
printf("%d%d%d", &a, &b, &c);
//就没有问题了
#include <stdio.h>
void main()
{
int a,b,c,max;
printf("please input a,b,c:\n");
scanf("%d,%d,%d",&a,&b,&c); //你没输逗号!
max=a;
max>b?max:max=b;
max>c?max=max:max=c;
printf("The largest number is %d\n",max);
}
please input a,b,c:
12,23,56
The largest number is 56
Press any key to continue