2 条题解

  • 0
    @ 2026-5-23 10:53:55
    #include<bits/stdc++.h>
    using namespace std;
    int main(){ //查找特定字母 C++17级
    	string s;
    	cin>>s;
    	char c;
    	cin>>c;
    	for(int i=0;i<s.length();i++){
    		if(s[i]==c){
    			cout<<i+1;
    			break;
    		}
    	}
        return 0;
    }
    
    
    • 0
      @ 2026-5-23 10:52:48
      #include<bits/stdc++.h>
      using namespace std;
      int main(){ //查找特定字母 C++17级
      	string s;
      	cin>>s;
      	char c;
      	cin>>c;
      	cout<<s.find(c)+1;
          return 0;
      }
      
      
      • 1

      信息

      ID
      2097
      时间
      1000ms
      内存
      256MiB
      难度
      10
      标签
      (无)
      递交数
      2
      已通过
      2
      上传者