Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- 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;
- int i,j,r=0,o=0;;
- i = a.length();
- j = b.length();
- if (i==j)
- {
- for(o=0;o<i;o++)
- {
- if(a[o]!=b[o])
- {
- r=r+1;
- }
- }
- if (r==1)
- {
- cout<<"sa metagramami"<<endl;
- }
- else
- {
- cout<<"nie sa"<<endl;
- }
- }
- else
- {
- cout<<"roznej dlugosci"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement