RT
原题传送men
my
code
:)
#include<bits/stdc++.h>
using namespace std;
char _str[100];
char str[100];
int tot;
char word[100];
bool ifSpace;
int main()
{
gets(_str);
for(int i=strlen(_str),j=0;i>=0;i--,j++) str[j]=_str[i];
for(int i=0;i<strlen(str);i++)
{
if(str[i]==' ')
{
if(ifSpace) printf(" ");
else
{
ifSpace=true;
tot=0;
for(int i=strlen(word)-1;i>=0;i--) printf("%c",word[i]);
printf(" ");
memset(word,'\0',sizeof(word));
}
}
else
{
word[tot]=str[i];
tot++;
}
}
for(int i=strlen(word)-1;i>=0;i--) printf("%c",word[i]);
return 0;
}
Q:为什么没输出
QwQ