Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. #include<fstream>
  4. using namespace std;
  5. struct zawodnik
  6. {
  7. string imie;
  8. string nazwisko;
  9. unsigned punkty;
  10. } ;
  11. int main()
  12. {
  13. ifstream odczyt("wyniki.txt");
  14. zawodnik tab[100];
  15. unsigned i=0;
  16. while(!odczyt.eof())
  17. {
  18. odczyt>>tab[i].imie;
  19. odczyt>>tab[i].nazwisko;
  20. odczyt>>tab[i].punkty;
  21. i++;
  22. }
  23. odczyt.close();
  24. unsigned n=i;
  25. cout<<" Wyniki zawodnikow: ";
  26. for(int i=0;i<n;i++)
  27. {
  28. cout<<tab[i].imie<<" "<<tab[i].nazwisko<<" "<<tab[i].punkty<<endl;
  29.  
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement