Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
word shufle match
#include <bits/stdc++.h> using namespace std; int main() { int n; cout<<"Enter the length:\n"; cin>>n; char str1[n], str2[n]; for(int i=0;i<n;i++) {cin>>str1[i];} for(int i=0; i<n;i++) {cin>>str2[i];} char temp1,temp2; for(int i=0; str1[i]!='\0'; i++) { for(int j=i+1;str1[j]!='\0';j++) { if (str1[i]>str1[j]) {temp1=str1[i]; str1[i]=str1[j]; str1[j]=temp1;} } } for(int i=0;str2[i]!='\0'; i++) { for(int j=i+1;str2[j]!='\0';j++) { if (str2[i]>str2[j]) {temp2=str2[i]; str2[i]=str2[j]; str2[j]=temp2;} } } cout<<str1<<endl<<str2<<endl; //if (str1==str2){cout<<"True";} //else{cout<<"False";} //cout<<a<<b; int a,b; for(int i=0; i<n;i++) { a=1; if(str1[i]==str2[i]) {a=0;} else {break;} } if(a==1){cout<<"False";} if(a==0){cout<<"True";} //else{cout<<"True";} return 0; }
run
|
edit
|
history
|
help
1
Please
log in
to post a comment.
HelloWorldExample
Flowchart segitiga
Ss
133
test if nullptr
temp_new
obracanie tablicy
pm zn moer 2.0
Height of a binary tree
Smart Pointers
Please log in to post a comment.