Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream fin("frunze.in");
- ofstream fout("frunze.out");
- int t[101];
- int main()
- {
- bool frunza;
- int n,rad,nrf=0;
- fin >> n;
- for(int i=1;i<=n;i++)
- {
- fin>>t[i];
- if(t[i]==0)
- rad=i;
- }
- fout<<rad<< "\n";
- for(int i=1;i<=n;i++)
- {
- frunza=true;
- for(int j=1;j<=n;j++)
- if(t[j]==i)
- frunza=false;
- if(frunza)
- nrf++;
- }
- fout<< nrf << "\n";
- for(int i=1;i<=n;i++)
- {
- frunza=true;
- for(int j=1;j<=n;j++)
- if(t[j]==i)
- frunza=false;
- if(frunza)
- fout<< i<< ' ';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement