#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<=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
求掉!!!