PAT-1009 说反话
来源:互联网 发布:免费听书软件下载 编辑:程序博客网 时间:2024/04/30 22:23
#include <iostream>#include <cstdio>#include <cstring>#include <cmath>using namespace std;#define MAX 100int main(){ //freopen("in.txt", "r", stdin); //freopen("out.txt", "w", stdout); char str[MAX], word[MAX][MAX]; gets(str); int j = 0, k = 0; char temp[MAX]; for (int i = 0; i < strlen(str); i++) { if (str[i] == ' ' || str[i] == '\0') { strcpy(word[k++], temp); j = 0; memset(temp, '\0', sizeof(temp)); continue; } temp[j++] = str[i]; if (i == strlen(str)-1) strcpy(word[k++], temp); } for(k--; k >= 0; k--) { cout << word[k]; if (k != 0) cout << " "; } return 0;}一年没写代码了,越写越烂。
0 0
- 1009 说反话 pat
- PAT 1009 说反话
- 1009 说反话 PAT
- PAT-1009 说反话
- 1009,说反话,PAT
- PAT 1009 说反话
- PAT 1009 说反话
- PAT 1009说反话
- PAT 1009 说反话
- PAT---1009说反话
- PAT basic 1009 : 说反话
- PAT乙级 1009 说反话
- PAT 乙级 1009 说反话
- PAT乙级1009 说反话
- PAT 1009 说反话 (20)
- PAT乙级1009: 说反话(20)
- PAT(basic level) 1009 说反话
- PAT-1009B 说反话 (20)
- hdu4280Island Transport
- vs 2015使用时有Cannot find one or more components.
- 如何检查STM32的HardFault_Handler故障
- 深入理解Apache Flink核心技术
- 理解Angular中的$digest()和$apply()
- PAT-1009 说反话
- 20. Valid Parentheses
- 抽象工厂模式
- redis 配置 与 数据结构
- HDU 3220 Alice’s Cube(逆向搜索)
- poj 1163 the triangle(dp)
- [C&C++]用WinSock封装自己的UDP类1
- iOS学习----------FMDB解析
- handler:message:looper机制