C++代码
- /*
- Title: Reverse Text
- Problem URL: http://acm.zju.edu.cn/show_problem.php?pid=1295
- Author: Moqi
- Date: 2007-12-30
- Description:
- */
- #include <stdio.h>
- #include <string.h>
- int main()
- {
- int i, n;
- char c[80];
- scanf("%d", &n);
- getchar();
- while (n > 0)
- {
- i = 0;
- while ((c[i++] = getchar()) != ‘\n’)
- ;
- i–;
- while (–i >= 0)
- putchar(c[i]);
- printf("\n");
- n–;
- }
- return 0;
- }