有木有大佬帮忙看看哪里错了,输不出结果
查看原帖
有木有大佬帮忙看看哪里错了,输不出结果
1415079
whx_1026楼主2024/11/2 17:41

请大佬看看哪里错了

#include<bits/stdc++.h>
using namespace std;
long long s,n,m;
int fu(int m){
	int s=0;
	if(m%2==0){
		s+=m;
		return s;
	}else{
		int y=m*7;
		while(y>9){
			int y=m%10+m/10;
		}
		s+=y;
		return s;
	}
}
int main(){
	cin>>n;
	while(n--){
		cin>>m;
		while(m>0){
			int u=m%10;
			s+=fu(u);
			m/=10;
			
		}
		if(s%8==0){
			cout<<"T";
		}else{
			cout<<"F";
		}
	}
	return 0;
}
2024/11/2 17:41
加载中...