蒟蒻又双叒叕来求救了
  • 板块灌水区
  • 楼主osfly
  • 当前回复9
  • 已保存回复9
  • 发布时间2020/9/6 13:18
  • 上次更新2023/11/5 13:37:57
查看原帖
蒟蒻又双叒叕来求救了
339299
osfly楼主2020/9/6 13:18

RTRT

原题传送men

mymy codecode :):)

#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

2020/9/6 13:18
加载中...