Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Problema 1
- #include <iostream>
- #include <string.h>
- using namespace std;
- char s[105], x[15], v[105], *p;
- int main(){
- cin.getline(s, 100);
- cin.getline(x, 15);
- p=strstr(s, x);
- while(p!='\0'){
- strcpy(v, p+strlen(x));
- s[p+strlen(x)-s]='?';
- strcpy(p+strlen(x)+1, v);
- p=strstr(p+strlen(x)+1, x);
- }
- cout << s;
- return 0;
- }
- ------------------
- Problema 2
- #include <iostream>
- #include <string.h>
- using namespace std;
- int i;
- char s1[201], s2[201], voc[]="aeiou";
- int main(){
- cin >> s1;
- cin >> s2;
- for(i=0;i<strlen(s1);++i)
- if(strchr(voc, s1[i]) && strchr(voc, s2[i]))
- cout << '*';
- else
- if(!strchr(voc, s1[i]) && !strchr(voc, s2[i]))
- cout << '#';
- else cout << '?';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement