样例过了但是0分 玄关求调谢谢(自己编的样例也过了)
查看原帖
样例过了但是0分 玄关求调谢谢(自己编的样例也过了)
1195678
wky2011楼主2024/8/27 18:05
#include<bits/stdc++.h>
#define ll long long
#define int long long
#define re read()
using namespace std;
const int N=3e5+5;
const int NN=3e3+5;
inline ll read(){
    ll x=0,f=1;char ch=getchar();
    while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
    return x*f;
}
int bian(int x){
	x*=7;
	if(x<=9)return x;
	while(x>9){
		x=x%10+x/10%10+x/100%10+x/1000%10+x/10000%10+x/100000%10+x/1000000%10+x/10000000%10+x/100000000%10+x/1000000000%10+x/10000000000%10+x/10000000000%10+x/100000000000%10+x/1000000000000%10;
		if(x<=9)return x;
	}
}int l;
void pd(string &x){
	for(int i=0;i<l;i+=2){
		x[i]=(char)bian((int)x[i]-'0')+'0';
		//cout<<x[i]<<' ';
	}
	
}
signed main(){
ios::sync_with_stdio(false);
int n=re;
for(int i=1;i<=n;i++) {
	string x;
	cin>>x;
	l=x.size() ;
	pd(x);
	int c=0;
	int ii=0;
	while(ii<l){
		c+=(int)x[ii]-'0';
		//cout<<(int)x[ii]-'0';
		ii++;
	}
	//cout<<c;
	if(c%8==0)cout<<'T'<<'\n';
	else cout<<'F'<<'\n';
}
return 0;
}

2024/8/27 18:05
加载中...