80分蒟蒻求调
查看原帖
80分蒟蒻求调
1004335
shixiaovya楼主2024/7/5 16:06

不知道为什么错,求解析

#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	getline(cin,s); 
	int l = s.find('\\')+1;
	if(s[l] == 'n'){
		cout << "linux";
	}else if(s[l] == 'r' && s[l+1] =='\\' && s[l+2] == 'n'){
		cout <<"windows";
	}else if(s[l] == 'r' && s[l+1] !='\\'){
		cout << "mac";
	}
	cout << l;
	return 0;
}
2024/7/5 16:06
加载中...