Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- int i,n,st[100],dr[100];
- ifstream fin("date.in");
- ofstream fout("date.out");
- fin>>n;
- for(i=1;i<=n;i++)
- fin>>st[i]>>dr[i];
- fout<<"frunzele: ";
- for(i=1;i<=n;i++)
- if(st[i]==0 && dr[i]==0) fout<<i<<" ";
- fout<<"\nvarfurile cu un singur descendent: ";
- for(i=1;i<=n;i++)
- if(st[i]*dr[i]==0 && st[i]+dr[i]!=0) fout<<i<<" ";
- fout<<"\nvarfurile cu doi descendenti: ";
- for(i=1;i<=n;i++)
- if(st[i] && dr[i]) fout<<i<<" ";
- fin.close();
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement