紧急求助
查看原帖
紧急求助
919235
customr楼主2023/2/17 11:59
#include<bits/stdc++.h>
#include <iostream>
using namespace std;
 
int main(){

	string s;
	cin>>s;
	char c[s.length()];
	int i;
	
	int temp=0;
	for(i=0;i<=s.length()-1;i++){

		if(s[i]==' '){//遇到空格就把之前数组里面的字符都倒序输出。
			while(temp>=1){
				cout<<c[temp];
				temp--;
			}
			cout<<endl;
		}else if(s[i]>='a'&&s[i]<='z'){
			temp++;
			c[temp]=s[i];
		}

	}


		return 0;
}

全错为什么

2023/2/17 11:59
加载中...