本帖最后由 河蟹 于 2013-11-23 11:48 编辑
输入数据时b和c前面要加&
[code=Cpp width=740px]#include <stdio.h>
#include <stdlib.h>
int main()
{
int a=1,b;
float c;
//a=1;
printf("请输入b和c的数值:");
scanf("%d%f",&b,&c); //int %d,float %f,
c=a+b;
printf("a与b之和赋给c所得值为:%f ",c);
system("pause");
return 0;
}[/code] |