PTA 基础编程题目集 7-32 说反话-加强版
作者:互联网
#include<iostream>
#include<string>
using namespace std;
int main(){
int i, arry[200000] = {0,0};
char c;
string str[200000];
for (i =1;; i++)
{
c = getchar();
if (c == ' ')
{
if (arry[i] == 0)
i--;
}
else if (c == '\n')
{
if (arry[i] == 0)
i--;
break;
}
else
{
str[i] += c; arry[i] = 1; i--;
}
}
for (int j = i; j >0; j--)
{
if (j != i)
cout << ' ';
cout << str[j];
}
}
标签:200000,加强版,--,32,PTA,else,int,include,arry 来源: https://blog.csdn.net/qq_63125992/article/details/122869162