请问我正在牛客练题,这两段程序为什么输出不一样呢。
int main() {
int a;
float b,c,d;
scanf("%d %f %f %f",&a,&b,&c,&d);
printf("The each subject score of No. %d is %.2f,%.2f,%.2f.\n",a,b,c,d);
return 0;
}
int main()
{
int id;
float c,math,eng;
scanf("%d;%f,%f,%f",&id,&c,&math,&eng);
printf("The each subject score of No. %d is %.2f, %.2f, %.2f.",id,c,math,eng);
return 0;
}
我运行上面的程序就显示:

就是C的值是0.
下面这段程序就能够运行成功