作了一个员工工资表:运行的时候怎么出现:先是Input name:(我就输入一个名字)但是按回车键,本想会出现Input salary:但是提示我的是下面的语句:
Input salary: scanf : floating point formats not linked Abnormal program termination
程序如下:
#include "stdio.h" struct teacher { int worknum; char name[20]; float salary; }; struct teacher s[20]; main() { int i; for(i=0;i<20;i++); { printf("Input work number:"); scanf("%d",&s[i].worknum); printf("Input name:"); scanf("%s",&s[i].name); printf("Input salary:"); scanf("%f",&s[i].salary); } for(i=0;i<20;i++) { printf("%d",s[i].worknum); printf("%s",s[i].name); printf("%f\n",s[i].salary); } }
请教各位大虾!