问一下find函数的用法
  • 板块灌水区
  • 楼主Zhouyc2009
  • 当前回复19
  • 已保存回复19
  • 发布时间2021/9/25 12:26
  • 上次更新2023/11/4 05:42:55
查看原帖
问一下find函数的用法
347750
Zhouyc2009楼主2021/9/25 12:26
#include<bits/stdc++.h>
using namespace std;
string str;
bool p,p1;
int main()
{
	cin>>str;
   	p=p1=true;
	if (find(str.begin(),str.end(),"\r")!=str.end()) p=true;
	if (find(str.begin(),str.end(),"\n")!=str.end()) p1=true;
	if (p&&p1) cout<<"Windows";
	  else if (p) cout<<"Mac";
	     else cout<<"Linux";
}

这样用有什么问题吗?qwq

2021/9/25 12:26
加载中...