#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void reverse(char *s)
{
int n = strlen(s);
char temp;
for (int i = 0, j = n - 1; i < n / 2; i++, j--)
{
temp = s[i];
s[i] = s[j];
s[j] = temp;
}
}
int main()
{
char s[50];
scanf("%s", s);
printf("strlrn of s is %d\n", strlen(s));
reverse(s);
printf("%s\n", s);
return 0;
}
494

被折叠的 条评论
为什么被折叠?



