Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string.h>
- using namespace std;
- ifstream f("virag.be");
- int N,hsz,isz;
- char V[1000];
- char S[1000];
- void Olvas()
- {
- f>>N;
- for(int i=0;i<=N-1;i++)
- {
- f>>V[i];
- if(V[i]=='H')
- hsz++;
- else
- isz++;
- }
- V[N]=0;
- cout<<V<<endl;
- }
- void Epit()
- {
- int p=0;
- for(int i=1;p<N;i++)
- {
- for(int j=1;j<=i && p<N;j++)
- { S[p]='I';
- p++;
- }
- if(p<N)
- {
- S[p]='H';
- p++;
- }
- }
- S[N]=0;
- cout<<S<<endl;
- }
- int main()
- {
- Olvas();
- Epit();
- cout<<isz<<endl;
- cout<<hsz<<endl;
- if(strcmp(S,V)==0)
- cout<<"Igen";
- else
- cout<<"Nem";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement