mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
34 lines
701 B
C++
34 lines
701 B
C++
|
#include<iostream>
|
||
|
#include<string>
|
||
|
using namespace std;
|
||
|
string word;
|
||
|
string buf;
|
||
|
int main(){
|
||
|
bool sign=true;
|
||
|
while(cin>>word){
|
||
|
if(sign){
|
||
|
buf+="Forty-two";
|
||
|
sign=false;
|
||
|
}
|
||
|
if(word[word.size()-1]=='.'){
|
||
|
buf.clear();
|
||
|
sign=true;
|
||
|
continue;
|
||
|
}
|
||
|
if(word[word.size()-1]=='?'){
|
||
|
buf+=" ";
|
||
|
buf+=word;
|
||
|
buf[buf.size()-1]='.';
|
||
|
cout<<buf<<endl;
|
||
|
buf.clear();
|
||
|
sign=true;
|
||
|
continue;
|
||
|
}
|
||
|
if(word != "What"){
|
||
|
buf+=" ";
|
||
|
buf+=word;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|