Advertisement
Guest User

Untitled

a guest
May 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4. int rima(char s[30], char t[30])
  5. {
  6. int i=0,j=0;
  7. while(s[i]!=0)
  8. i++;
  9. while(t[j]!=0)
  10. j++;
  11. if((s[i-1]==t[j-1]) && (s[i-2]==t[j-2]))
  12. return 1;
  13. else
  14. return 0;
  15. }
  16. int main()
  17. {
  18. char s[30],t[30];
  19.  
  20. cout<<"Introduceti primul sir de caractere : ";cin>>s;
  21. cout<<"Introduceti al doilea sir de caractere : ";cin>>t;
  22. if(rima(s,t)==1)
  23. cout<<s<<" rimeaza cu "<<t<<endl;
  24. else
  25. cout<<s<<" nu rimeaza cu "<<t<<endl;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement