AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCCCCCCCCCCCCC

? · 发布于 2025-10-02 · 浏览 479 回复 0
#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
long long  n = 0,val,idx = 1,S;
int f1(int x){
	int s = 0;
	x*=7;
	if(x<=9)return x;
	while (x > 9){
		while(x){
			s += x % 10;
			x/=10;
		} 
		x = s;
		s = 0;
	}
	return x;
}
int main(){
	cin >> n;
	int a = 0;
	for(int i = 1;i<= n;i++){
		cin >> val;
		long long tmp = val;
		S = 0;
		idx = 1;
		while(tmp>0){
			if(idx%2){
				a = f1(tmp %10);
				val -=(tmp %10)*pow(10,idx-1);
				val += a*pow(10,idx-1);
				S += a;
		//		cout << tmp%10<<endl;
		//		cout << a << endl;
			}
			if(idx %2 == 0)
			
				S += tmp%10;
			tmp /= 10;
			idx++;	
		}
	//	cout << val << endl;
		if(S%8 == 0)printf("T\n");
		else printf("F\n");
	}
		

	return 0;
}

不用谢

全部回复 共 0 条

还没有人回复。往下写第一条。

发表回复