Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string.h>
- using namespace std;
- int main()
- {int n,i,j,ok,aux=0;
- char x[20], a[20];
- cin>>n;
- cin>>x; //primul cuvant
- while(n>1)
- {cin>>a;
- ok=0;
- j=strlen(x)-1;
- for(i=strlen(a)-1; i>=0;i--)
- {if(x[j]==a[i])
- ok++;
- j--;}
- if(ok==strlen(x))
- aux++;
- n--;}
- cout<<aux;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement