【HUSTOJ】1111: 单词调换位置
2016-05-11 21:01
85 查看
1111: 单词调换位置
Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 57 Solved: 16
原题链接
Description
将用逗号隔开的两个英语单词交换位置输出
Input
一行以逗号隔开的两个单词
Output
将两个单词交换后输出
Sample Input
abc,de
Sample Output
de,abc
HINT
Source
#include<iostream> #include<string.h> using namespace std; main() { char s[10000],t[10000]; int i=0; while(cin>>s[i]) { if(s[i]==',') {s[i]='\0';break;} i++; } cin>>t; strcat(t,","); cout<<t<<s<<endl; }
相关文章推荐
- 最大似然估计(MLE)和最大后验概率(MAP)
- windows命令行启动虚拟机(VirtualBox、VMware)
- 如何使用控制台操作数据库
- 图像处理之高斯金字塔
- Android之自定义标题--使用自定义Layout
- 拓扑排序
- 匈牙利算法模板及解释
- Java中的Set与hashCode
- 杭电1269-Tarjan算法
- vim查找替换
- Android Studio报错,Error:SSL peer shut down incorrectly
- 布局管理器
- 字符串处理(库函数)
- TCP与UDP(实时通讯)
- 人见人爱A+B
- Stanford 机器学习 Anomaly Detection
- 积木算法
- 258. Add Digits [easy] (Python)
- mysql数据访问
- 符号三角形