Advertisement
Guest User

Untitled

a guest
Jan 29th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <string.h>
  3. #include<stdio.h>
  4. using namespace std;
  5. char a[101], b[101], s[101];
  6. int i=0,j,ok=1;
  7. int main()
  8. {cout<<'cuvant1:'; cin>>a;
  9. cout<<'cuvant2:'; cin>>b;
  10. do
  11. {
  12. if(a[strlen(a]-1-i)]==b[strlen(b)-1-i])
  13. S[i]=a[strlen(a)-1-i]
  14.  
  15. else ok=0;
  16. i++
  17. }
  18. while(ok!=0)
  19. for(j=strlen(s))-1;j>=a;j++)
  20. cout<<s[j];
  21. return 0;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement