字符串-04. 字符串逆序

 1 /*
 2  * Main.c
 3  * D4-字符串-04. 字符串逆序
 4  *  Created on: 2014年8月19日
 5  *      Author: Boomkeeper
 6  *******测试通过******
 7  */
 8 
 9 #include <stdio.h>
10 
11 int main(void){
12 
13     char str[80];
14 
15     gets(str);
16 
17     int i;
18     for(i=0;i<80;i++){
19         if(str[i]=='')
20             break;
21     }
22 
23     int j;
24     for(j=i-1;j>=0;j--){
25         putchar(str[j]);
26     }
27 
28     return 0;
29 }

 题目链接:

http://pat.zju.edu.cn/contests/basic-programming/%E5%AD%97%E7%AC%A6%E4%B8%B2-04

 

.

原文地址:https://www.cnblogs.com/boomkeeper/p/D4.html