SWUSTOJ #171 字符串的倒序

版权声明:知识不设限,可自由转载,请附上连接: https://blog.csdn.net/qq_44475551/article/details/89635109

SWUSTOJ #171 字符串的倒序

题目

设计函数,实现字符串的倒序输出。

输入

输出

样例输入

Tomorrow
Yesterday
Today
Tomorrowisantherday!
Debug\ee.exe
ee-MicrosoftVisualC+±[ee.cpp]

样例输出

worromoT
yadretseY
yadoT
!yadrehtnasiworromoT
exe.ee\gubeD
]ppc.ee[-++ClausiVtfosorciM-ee

源代码

#include <stdio.h>
#include <string.h>

int main()
{
	char s[100];
	while(~scanf("%s", s))
	{
		int n;
		n=strlen(s);
		for(int i=n-1; i>=0; i--)
		{
			printf("%c", s[i]);
		}
		printf("\n");
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_44475551/article/details/89635109