B3850 幸运数
时间:2024-05-13 13:18
作者:admin
点击:次
#include iostream#include algorithmusing namespace std;int main(){ long long n,m,s=0,t; cinn; while(n--){ s=0; cinm; int i=0; while(m){ i++; if(i%2){ t=m%10*7; while(t9) t=t%10+t/10; } else t=m%10; s+=t; m/=10; } if(s%8==0) cout"T\n"; else
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
long long n,m,s=0,t;
cin>>n;
while(n--){
s=0;
cin>>m;
int i=0;
while(m){
i++;
if(i%2){
t=m%10*7;
while(t>9) t=t%10+t/10;
}
else t=m%10;
s+=t;
m/=10;
}
if(s%8==0) cout<<"T\n";
else cout<<"F\n";
}
return 0;
}
(责任编辑:admin) |