Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<string.h>
- int siz(char s[]) {
- int size=0;
- for(int i=0;s[i]!='\0';i++) {
- size++;
- }
- return size;
- }
- int main() {
- char a[] = "tnelis";
- char b[] = "silent";
- int size_a = siz(a);
- int size_b = siz(b);
- if(size_a!=size_b) {
- printf("TRUE");
- }
- else{
- int ans = 0;
- for(int i=0;i<size_a;i++) {
- if(a[i]!=b[size_b-i-1]) {
- ans = 1;
- break;
- }
- }
- if(ans) printf("TRUE");
- else printf("FALSE");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement