tranght

Untitled

Feb 6th, 2017
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #define size 50
  4. struct student
  5. {
  6. char name[30];
  7. int num;
  8. int sub[3];
  9. };
  10. int main()
  11. {
  12. int i, j, n,sum,s[size],max;
  13. struct student st[size];
  14. printf("so luong student la ");
  15. scanf_s("%d", &n);
  16. fflush(stdin);
  17. for (i = 1;i <= n;i++)
  18. {
  19. printf("%d.ten va ma sinh vien: ", i);
  20. gets_s(st[i].name);
  21. fflush(stdin);
  22. scanf_s("%d", &st[i].num);
  23. fflush(stdin);
  24. }
  25. for (i = 1;i <= n;i++)
  26. {
  27. for (j = 1;j <= 3;j++)
  28. {
  29. printf("SV %d co diem cho mon hoc thu %d la ", i, j);
  30. scanf_s("%d", &st[i].sub[j]);
  31. fflush(stdin);
  32. }
  33. }
  34. system("PAUSE");
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment