20分求助
查看原帖
20分求助
1803776
sunhaochen2009楼主2025/7/19 11:28
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string k;
    getline (cin,k);
    int n=k[0]-48;
    for(int i=0;i<n;i++)
    {
    	string a;
    	getline (cin,a);
    	int si=a.size();
    	for(int i1=0;i1<si;i1++)
    	{
    		if((i1+1)%2==1)
    		{
    			int kp=a[i1]-48;
    	//	cout<<kp<<"st"<<endl;
    			kp=kp*7;
    			while(kp>9)
    			{
    				int ko=kp;
    				kp=0;
    				while(ko)
    				{
    					kp=kp+ko%10;
    					ko=ko/10;
					}
				}
		//		cout<<kp<<endl;
				a[i1]=kp+48;
			}
		}
		int he;
	//	cout<<a<<endl;
	for(int i5=0;i5<si;i5++)
	{
		he=he+a[i5]-48;
	}
//	cout<<he;
	if(he%8==0)
	{
		cout<<"T";
	}
	else
	{
		cout<<"F";
	}
	}
	
}
2025/7/19 11:28
加载中...