求助
查看原帖
求助
117648
tuzhewen楼主2020/6/12 20:14

莫名WA了qaq

#include<bits/stdc++.h>
using namespace std;
string s1,ans;
int main() {
	cin>>s1;
	for(int i=0;i<s1.length();i++) {
		if(s1[i]=='/'&&s1[i+1]!='/') {
			if(i==s1.length()-1) break;
			else ans.push_back(s1[i]);
		}
		else if(s1[i]!='/') ans.push_back(s1[i]);
	}
	return cout<<ans<<endl,0;
}
2020/6/12 20:14
加载中...