0
My code will have a flaw that takes much time when uses s3,s4..sn.So may you give me a new method to fix that code to be more ea
#include<stdio.h> #include<string.h> typedef struct{ int age; float mark; char name[20]; }student; int main(){ student s1,s2; scanf(" %d%f%s",&s1.age,&s1.mark,s1.name); printf("age sv1: %d\n",s1.age); printf("mark sv1: %.2f\n",s1.mark); printf("namesv1: %s\n",s1.name); scanf(" %d%f%s",&s2.age,&s2.mark,s2.name); printf("age sv2: %d\n",s2.age); printf("mark sv2: %.2f\n",s2.mark); printf("name sv2: %s\n",s2.name); return 0; }
0 Antworten