3 条题解

  • 1
    @ 2025-3-29 14:32:21
    using namespace std;
    int main()
    {
    	string a;
    	getline(cin,a);
    	int ans=0;
    	for(int i=0; i<a.size(); i++)
    	{
    		if(a[i]==' '||a[i]=='a'||a[i]=='d'||a[i]=='g'||a[i]=='j'||a[i]=='m'||a[i]=='p'||a[i]=='t'||a[i]=='w')
    		ans++;
    		if(a[i]=='b'||a[i]=='e'||a[i]=='h'||a[i]=='k'||a[i]=='n'||a[i]=='q'||a[i]=='u'||a[i]=='x')
    		ans+=2;
    		if(a[i]=='c'||a[i]=='f'||a[i]=='i'||a[i]=='l'||a[i]=='o'||a[i]=='r'||a[i]=='v'||a[i]=='y')
    		ans+=3;
    		if(a[i]=='s'||a[i]=='z')
    		ans+=4;
    	}
    	cout<<ans;
    	return 0;
    }
    
    

    信息

    ID
    2023
    时间
    1000ms
    内存
    512MiB
    难度
    2
    标签
    递交数
    72
    已通过
    43
    上传者