1. To reverse each word in the string
# You are using Python
n=input()
n=n.split(" ")
for i in n:
j="".join(reversed(i))
print(j,end=" ")
2. To check the string is anagrams or not
// You are using GCC
#include<stdio.h>
#include<string.h>
int main()
{
char a[50],b[50];
scanf("%s",&a);
scanf("%s",&b);
if(strlen(a)==strlen(b))
printf("true");
else
printf("false");
}
No comments:
Post a Comment