Advertisement
Guest User

Probleme pt Ruxi Puxi

a guest
Nov 19th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Problema 1
  2.  
  3. #include <iostream>
  4. #include <string.h>
  5. using namespace std;
  6. char s[105], x[15], v[105], *p;
  7. int main(){
  8. cin.getline(s, 100);
  9. cin.getline(x, 15);
  10. p=strstr(s, x);
  11. while(p!='\0'){
  12. strcpy(v, p+strlen(x));
  13. s[p+strlen(x)-s]='?';
  14. strcpy(p+strlen(x)+1, v);
  15. p=strstr(p+strlen(x)+1, x);
  16. }
  17. cout << s;
  18. return 0;
  19. }
  20.  
  21. ------------------
  22.  
  23. Problema 2
  24.  
  25. #include <iostream>
  26. #include <string.h>
  27. using namespace std;
  28. int i;
  29. char s1[201], s2[201], voc[]="aeiou";
  30. int main(){
  31. cin >> s1;
  32. cin >> s2;
  33. for(i=0;i<strlen(s1);++i)
  34. if(strchr(voc, s1[i]) && strchr(voc, s2[i]))
  35. cout << '*';
  36. else
  37. if(!strchr(voc, s1[i]) && !strchr(voc, s2[i]))
  38. cout << '#';
  39. else cout << '?';
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement