Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- ifstream f("inserarechar.in");
- ofstream g("inserarechar.out");
- char a[20],s[256],*p,aux[1000];
- int main()
- {
- bool ok=0;
- f>>a;
- f.get();
- f.get(s,256);
- p=strtok(s," ");
- while(p)
- {
- bool ok1=1;
- if(strlen(p)!=strlen(a))
- ok1=0;
- else
- for(int i=0; i<strlen(p); i++)
- if(p[i]!=a[i])
- ok1=0;
- if(ok1==1)
- {
- strcat(aux,p);
- strcat(aux,"? ");
- ok=1;
- }
- else
- {
- strcat(aux,p);
- strcat(aux," ");
- }
- p=strtok(NULL," ");
- }
- if(ok==0)
- g<<"NU APARE";
- else
- g<<aux;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement