Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- int n, T[100], p[100],z;
- using namespace std;
- ifstream f("6.in");
- int main()
- {
- int i,nr_ap,j;
- f>>n;
- for(i=1; i<=n; i++)
- {
- f>>T[i];
- p[T[i]]=1;
- }
- cout<<"Frunzele sunt: ";
- for(i=1; i<=n; i++)
- if(!p[i])
- {
- cout<<i<<" ";
- z++;
- }
- cout<<"in numar de "<<z;
- for(i=1; i<=n; ++i)
- {
- int nr_ap=0;
- for(j=1; j<=n; ++j)
- if(T[j]==i)
- nr_ap++;
- if(nr_ap>2)
- {
- i=n+2;
- cout<<"\nNu este binar";
- }
- }
- if(i!=n+3)
- cout<<"\nEste binar";
- }
- /*
- 6.in
- 6
- 5 1 1 3 0 3
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement