Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include<cstring>
- using namespace std;
- int main()
- {
- char s1[21],s2[21],aux;
- cout<<"s1=";
- cin>>s1;
- cout<<"s2=";
- cin>>s2;
- int i,j;
- if(strlen(s1)!=strlen(s2))
- cout<<"nu";
- else
- {
- for(i=0;i<strlen(s1)-1;i++)
- for(j=i+1;j<strlen(s1);j++)
- if(s1[i]>s1[j])
- {
- aux=s1[i];
- s1[i]=s1[j];
- s1[j]=aux;
- }
- for(i=0;i<strlen(s2)-1;i++)
- for(j=i+1;j<strlen(s2);j++)
- if(s2[i]>s2[j])
- {
- aux=s2[i];
- s2[i]=s2[j];
- s2[j]=aux;
- }
- if(strcmp(s1,s2)==0)
- cout<<"da";
- else
- cout<<"nu";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement