Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cstring>
- using namespace std;
- ifstream fin("clasa.txt");
- struct bara{
- char nume[20],prenume[20];
- int zi,luna,an;
- }elev[30];
- int main()
- {
- int nr,caun=1,caup=1, j=0;
- cin>>nr;
- cin.get();
- cout<<"+----------------------+---------------+";
- char s[110];
- for (int i=0;i<nr;i++)
- {
- j=0;
- fin.getline(s,110);
- while(s[j]!= ' ')
- {
- elev[caun].nume[j] = s[j];
- j++;
- }
- caun++;
- j++;
- while(s[j]!= '/')
- {
- elev[caun].prenume[j] = s[j];
- j++;
- }
- }
- cout<<elev[1].nume;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement