2 条题解

  • 0
    @ 2023-8-27 10:07:41
    #include<iostream>
    #include<algorithm>
    using namespace std;
    int main(){	 //C++17级 后缀是er的单词数量 
    	string s; 
    	int ans=0;
    	getline(cin,s);
    	s+=' ';
    	for(int i=0;i<s.length();i++){
    		if(s[i]=='e' and s[i+1]=='r' and s[i+2]==' ')
    			ans++;
    	}
    	cout<<ans;
    	return 0;
    }
    
    • 1

    蓝桥杯编程等级考试C++17级_后缀是er的单词数量

    信息

    ID
    563
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    28
    已通过
    12
    上传者