90pts求助
查看原帖
90pts求助
773371
Dreeick楼主2023/9/10 10:58

rt,第四个点不知道神马沙雕问题错了

#include <iostream>
#include <string>

using namespace std;

string s1,s2;
int st;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> s1 >> st;
	//修改成数字序列
	for(int i = 0;i < s1.length();i++){
		s2.append(to_string(st+(s1[i]-'A')));
	}
	s1 = s2;
	while(s1.length() > 4){
		s2.clear();
		for(int i = 0;i < s1.length()-1;i++){
			s2 += (((s1[i] - '0') + (s1[i+1] - '0')) % 10) + '0';
		}
		s1 = s2;
	}
	while(stoi(s1) > 100){
		s2.clear();
		for(int i = 0;i < s1.length()-1;i++){
			s2 += (((s1[i] - '0') + (s1[i+1] - '0')) % 10) + '0';
		}
		s1 = s2;
	}
	cout << stoi(s1);

	return 0;
}
2023/9/10 10:58
加载中...