第一条程序:
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d%d",&a,&b);
scanf("%d",&c);
printf("%d,%d,%d",a,b,c);
return 0;
}
输入1 2回车,再输入3回车,能正确得到结果1,2,3
第二条程序:
#include <stdio.h>//
int main()
{
int a,b,c;
scanf("%d%d",&a,&b);
scanf("c=%d",&c);//此处增加c=
printf("%d,%d,%d",a,b,c);
return 0;
}
第二个scanf函数的引号里增加c=,再像上个程序那样输入则得不到正确结果,输入1 2回车后即结束运行。输入1 2c=3才能得到正确结果。
有大神解释一下吗?谢谢.
#include <stdio.h>
int main()
{
int a,b,c;
scanf("%d%d",&a,&b);
scanf("%d",&c);
printf("%d,%d,%d",a,b,c);
return 0;
}
输入1 2回车,再输入3回车,能正确得到结果1,2,3
第二条程序:
#include <stdio.h>//
int main()
{
int a,b,c;
scanf("%d%d",&a,&b);
scanf("c=%d",&c);//此处增加c=
printf("%d,%d,%d",a,b,c);
return 0;
}
第二个scanf函数的引号里增加c=,再像上个程序那样输入则得不到正确结果,输入1 2回车后即结束运行。输入1 2c=3才能得到正确结果。
有大神解释一下吗?谢谢.