【A.Little Sub and Applese】逆水行舟用力撑,一篙松劲退千寻。这篇文章主要讲述A.Little Sub and Applese相关的知识,希望能为你提供帮助。
Description
’Why are you always repeating what I say?’ says Applese, a friend of Little Sub.
’Because it is the most important quality of mankind.’ says Little Sub.
Now it is your turn to repeat what Applese says.
Generally, each sentence Applese says will only contains ’A’..’Z’, ’a’..’z’, ’0’..’9’, space, ’!’ and ’.’.
Each sentence will definitely end with either ’!’ or ’.’. If it ends with ’.’, change it to ’!’ instead.
Applese has just passed his 17th birthday, we wish him and his friends very good luck in the future study and programming competitions.
Input
There are multiple cases, please read until the end of file.
Each case will only contain one sentence in one line, indicating what Applese says. The total length of all sentences will not exceed 1000000.
Output
Output the answer in one line for each case.
Author
YE, Zicheng
题解:给你一个带空格的字符串,如果结尾是"
."
,改成"
!"
后输出.
超级水题.
#include <
iostream>
#include <
cstring>
const int N=1e6+5;
using namespace std;
char s[N];
int main()
{
while(cin.getline(s,N-3)){
int len=strlen(s);
if(s[len-1]=='
.'
) s[len-1]='
!'
;
cout<
<
s<
<
endl;
}
//cout <
<
"
Hello world!"
<
<
endl;
return 0;
}
推荐阅读
- git推送报错( No path specified. See 'man git-pull' for valid url syntax或does not appear to be a)
- Centos使用natapp教程
- androidstudio导入新项目build tools不符合问题解决
- Java内存模型与Volatile,Happen-Before原则等
- pwnable.twapplestore 分析
- Android 使用URL访问网络资源
- WordPress开发app(小程序)接口开发教程
- 深度学习原理与框架-递归神经网络-RNN网络基本框架(代码?) 1.rnn.LSTMCell(生成单层LSTM) 2.rnn.DropoutWrapper(对rnn进行dropout操作) 3.tf.
- cocos creator基础-(二十三)android环境搭建h5/android 打包发布