Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <bits/stdc++.h>
- using namespace std;
- void sortString(string &x)
- {
- sort(x.begin(),x.end());
- }
- int main()
- {
- int n;
- cout<<"ile prob? "<<endl;
- cin>>n;
- for (int m=0;m<n;m++)
- {
- string a,b;
- cout<<"podaj 1 slowo "<<endl;
- cin>>a;
- cout<<"podaj 2 slowo "<<endl;
- cin>>b;
- sortString(a);
- sortString(b);
- if (a==b)
- {
- cout<<"sa anagramami"<<endl;
- }
- else{cout<<"nie sa anagramami"<<endl;}
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement