灵异代码求掉!!!
查看原帖
灵异代码求掉!!!
1304502
China_U_19641016楼主2025/1/19 14:07
#include<bits/stdc++.h>
using namespace std;	
int k,t,q=2011,a[600];
string s;
int main(){
	do{
		a[++t]=q;
		q=(q*2011)%10000; 
	}while(q!=2011);
	cin>>k;
	//for(int i=1;i<=500;i++){
	//	cout<<a[i]<<endl;
	//}
	for(int i=1;i<=k;i++){
		cin>>s;
		int l=0,m=0;
		m=s.size();
		if(m==1) l=s[m-1];
		else if(m==2) l=s[m-1]+s[m-2]*10;
		else if(m==3) l=s[m-1]+s[m-2]*10+s[m-3]*100;
		else l=s[m-1]+s[m-2]*10+s[m-3]*100;
		cout<<m<<" "<<(l==s[m-1])<<endl;
		cout<<l<<" "<<s[m-1]; 
	}
	return 0;
}

输入1 5时,输出为:

1 1
53 5

求掉!!!

2025/1/19 14:07
加载中...