样例已过,仅十分,求助
查看原帖
样例已过,仅十分,求助
1081521
Sci_8633楼主2024/6/26 19:29
#include<bits/stdc++.h>
using namespace std;
int n;
string s;
int main(){
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	while(n--){
		cin>>s;
		int len=s.length();
		for(int i=0;i<len;++i){
			if((s[i]-'0')%2==1){
				int t=(s[i]-'0')*7;
				while(t>9){
					t=t%10+t/10%10;
				}
				s[i]=char(t+'0');
			}
		}
		int sum=0;
		for(int i=0;i<len;++i){
			sum+=int(s[i]-'0');
		}
		if(sum%8==0)	cout<<"T"<<"\n";
		else	cout<<"F"<<"\n";
	}
	return 0;
}
2024/6/26 19:29
加载中...