Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstring>
- #include<fstream>
- using namespace std;
- struct zawodnik
- {
- string imie;
- string nazwisko;
- unsigned punkty;
- } ;
- int main()
- {
- ifstream odczyt("wyniki.txt");
- zawodnik tab[100];
- unsigned i=0;
- while(!odczyt.eof())
- {
- odczyt>>tab[i].imie;
- odczyt>>tab[i].nazwisko;
- odczyt>>tab[i].punkty;
- i++;
- }
- odczyt.close();
- unsigned n=i;
- cout<<" Wyniki zawodnikow: ";
- for(int i=0;i<n;i++)
- {
- cout<<tab[i].imie<<" "<<tab[i].nazwisko<<" "<<tab[i].punkty<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement