Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <bits/stdc++.h>
- using namespace std;
- void sortString(string &str)
- {
- sort(str.begin(), str.end());
- }
- int main()
- {
- 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<<"Slowa SA anagramami"<<endl;
- }
- else
- {
- cout<<"Slowa NIE SA anagramami"<<endl;
- }
- }
- /// Bartosz Kowalski 2020
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement