[恢]hdu 1321
2011-12-16 02:16:43
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1321
题意:字符串逆序输出- -。
代码:
# include <stdio.h>
# include <string.h>
char str[100] ;
int main ()
{
int n, i, len ;
scanf ("%d%*c", &n) ;
while (n--)
{
gets (str) ;
len = strlen(str) ;
for (i = len-1; i >= 0 ; i--)putchar (str[i]) ;
printf ("\n") ;
}
return 0 ;
}