Advertisement
Guest User

staryniepijany

a guest
Dec 6th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. #include <cstdlib>
  4. #include <fstream>
  5. using namespace std;
  6.  
  7. struct osoba
  8. {
  9. string imie, nazwisko;
  10. int rok, styN, styS;
  11. }stud[5];
  12. int main()
  13. {
  14.  
  15. ifstream dane("stypendium.txt");
  16. double suma=0;
  17.  
  18. for(int i=0; i<5; i++)
  19. {
  20. dane>>stud[i].imie;
  21. dane>>stud[i].nazwisko;
  22. dane>>stud[i].rok;
  23. dane>>stud[i].styN;
  24. dane>>stud[i].styS;
  25. }
  26. for (int i=0;i<5;i++)
  27. {
  28. cout<<"\n\n"<<i+1<<". "<<stud[i].imie<<" "<<stud[i].nazwisko<<" "<<stud[i].rok<<" "<<stud[i].styN<<" "<<stud[i].styS<<endl;
  29. }
  30. dane.close();
  31. system("pause");
  32. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement