Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <cstdlib>
- #include <fstream>
- using namespace std;
- struct osoba
- {
- string imie, nazwisko;
- int rok, styN, styS;
- }stud[5];
- int main()
- {
- ifstream dane("stypendium.txt");
- double suma=0;
- for(int i=0; i<5; i++)
- {
- dane>>stud[i].imie;
- dane>>stud[i].nazwisko;
- dane>>stud[i].rok;
- dane>>stud[i].styN;
- dane>>stud[i].styS;
- }
- for (int i=0;i<5;i++)
- {
- cout<<"\n\n"<<i+1<<". "<<stud[i].imie<<" "<<stud[i].nazwisko<<" "<<stud[i].rok<<" "<<stud[i].styN<<" "<<stud[i].styS<<endl;
- }
- dane.close();
- system("pause");
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement