虽然我看不懂,但我大受震撼

代码来喽

#include <bits/stdc++.h>
using namespace std;

int main()
{
	string s;
	int sum = 0;
	getline(cin, s);
	for(int i = 0; i < s.length(); i++)
	{
		if (s[i] >= 'a' && s[i] <= 'z')
		{
			sum += (s[i] - 'a' + 1);
		}
		if (s[i] >= 'A' && s[i] <= 'Z')
		{
			sum += (s[i] - 'A' + 1);
		}
	}
	cout << sum << "%";
	return 0;
}
6 个赞
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要
摘要

蒟蒻都会打的代码 :stuck_out_tongue_closed_eyes:

5 个赞


4 个赞

不要玩梗不然你的生活会减少72%

4 个赞

image

4 个赞

image
image
@tyx @白桐吉

4 个赞

还得是我家鸽鸽腻害
屏幕截图 2023-07-19 110008
屏幕截图 2023-07-19 110031
屏幕截图 2023-07-19 110111

3 个赞

#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
while(cin>>s){
int sum = 0;
for(int i=0;i<s.length();i++)
{
if(s[i]>=‘a’&&s[i]<=‘z’)
{
sum+=(s[i]-‘a’+1);
}
if (s[i]>=‘A’&& s[i]<=‘Z’)
{
sum+=(s[i]-‘A’+1);
}
}
cout<<sum<<endl;
}
return 0;
}
多次使用(我家鸽鸽太厉害了)

4 个赞

2 个赞

蛙趣

好6

1 个赞

7cba0c7676606372252bfced73c663fa435614d5.png (1295×523) (xinyoudui.com)

1 个赞

1 个赞