我用vs输入代码,运行后打了一行之后按enter键,输入不了下一行,光标一直闪,再过一会就弹出按任意键结束的对话。这是怎么回事?
代码在这里:
#include<stdio.h>
#include<string.h>
int main()
{ int i;
struct student
{long num;
char name[10];
float score;
}A[10];
struct student *p;
for(i=0;i<10;i++)
scanf("%ld%s%f",&A[i].num,A[i].name,&A[i].score);
p=A;
for(p=A;p<A+10;p++)
{printf("\nNO.:%ld\nname:%s\nscore:%6.2f\n",(*p).num,(*p).name,(*p).score);
}
return 0;
}
代码在这里:
#include<stdio.h>
#include<string.h>
int main()
{ int i;
struct student
{long num;
char name[10];
float score;
}A[10];
struct student *p;
for(i=0;i<10;i++)
scanf("%ld%s%f",&A[i].num,A[i].name,&A[i].score);
p=A;
for(p=A;p<A+10;p++)
{printf("\nNO.:%ld\nname:%s\nscore:%6.2f\n",(*p).num,(*p).name,(*p).score);
}
return 0;
}