Advertisement
patryk178

Untitled

Sep 23rd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. bool sprawdz(string napis,string napis2)
  6. {
  7.     if(napis.size()!=napis2.size())return false;
  8.  
  9.     for(int i=1;i<napis.size();i++)
  10.     {
  11.         for(int j=0;j<napis.size();j++)
  12.         {
  13.             if(napis[j]>napis[i])
  14.             {
  15.                 int pom = napis[j];
  16.                 napis[j] = napis[i];
  17.                 napis[i] = pom;
  18.             }
  19.  
  20.             if(napis2[j]>napis2[i])
  21.             {
  22.                 int pom = napis2[j];
  23.                 napis2[j] = napis2[i];
  24.                 napis2[i] = pom;
  25.             }
  26.         }
  27.     }
  28.  
  29.     if(napis==napis2)return true;
  30.     return false;
  31. }
  32.  
  33. int main()
  34. {
  35.     string napis,napis2;
  36.     cin>>napis>>napis2;
  37.     cout<<sprawdz(napis,napis2);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement