10 条题解

  • 0
    @ 2022-10-4 0:04:09
    #include <iostream>
    #include <string.h>
    #include <stdio.h>
    #include <algorithm>
    using namespace std;
    int main(){ 
    	int n,sum=-1;
    	string s;
    	cin>>n>>s;
    	char a;
    	cin>>a; 
    	for(int j=0;j<n;j++)
    	{
    		if(a == s[j])
    		{
    		sum=j;break;
    		}			 
    	}
    	cout<<sum;
    	return 0;
    }
    

    信息

    ID
    37
    时间
    1000ms
    内存
    128MiB
    难度
    8
    标签
    递交数
    6116
    已通过
    1170
    上传者