提交全WA,但是我测试第一组数据跟答案是一样的
查看原帖
提交全WA,但是我测试第一组数据跟答案是一样的
333976
C艹天下第一楼主2020/6/5 16:03
#include<iostream>  //2020.6.5
#include<string>
using namespace std;
int main(void)
{
	string str;
	getline(cin,str);
	long long int total=0;
	for(int i=0;i<str.size();++i)
	{
		if(str[i]==' ')
		{
			total+=1;
			continue;
		}
		if(str[i]<100)
		{
			total+=str[i]-96;
			continue;
		}
		if(str[i]<103)
		{
			total+=str[i]-99;
			continue;
		}
		if(str[i]<106)
		{
			total+=str[i]-102;
			continue;
		}
		if(str[i]<109)
		{
			total+=str[i]-105;
			continue;
		}
		if(str[i]<112)
		{
			total+=str[i]-108;
			continue;
		}
		if(str[i]<116)
		{
			total+=str[i]-111;
			continue;
		}
		if(str[i]<119)
		{
			total+=str[i]-115;
			continue;
		}
		if(str[i]<123)
		{
			total+=str[i]-118;
			continue;
		}
	}
	cout<<total;
	return 0;
 } 
2020/6/5 16:03
加载中...