#include
struct score
{
char name[20];
char id[15];
char class[500];
float English;
float Math;
float Network;
float C;
};
int main ()
{
struct score sc;
printf ("Please input name \n");
scanf("%s",sc.name);
printf ("Please input id \n");
scanf("%s",sc.id);
printf ("Please input Math score \n");
scanf("%f" , &sc.Math);
printf ("Please input Network score \n");
scanf("%f", &sc.Network );
printf ("Please input C ");
scanf("%f", &sc.C );
{
if (sc.C>100||sc.C<0)
{
printf("your C score is wrong\n");
}
}
printf ("Please input English score\n");
scanf ("%f", &sc.English);
{
if (sc.English>100||sc.English<0)
{
printf("your English score is wrong\n");
return 0;
}
}
printf ("------------My score--------\n");
printf ("Name %s\n",sc.name );
printf ("id %s\n",sc.id);
printf ("Class %s\n",sc.class);
printf ("English \t\t %0.1f\n",sc.English);
printf ("Math \t\t %0.1f\n",sc.Math);
printf ("Network \t\t %0.1f\n",sc.Network);
printf ("C \t\t %0.1f\n",sc.C);
printf("-----------------------------\n");
}
阅读(1587) | 评论(0) | 转发(0) |