为什么会错?!!求助
查看原帖
为什么会错?!!求助
993384
wsysqq楼主2024/11/1 18:01
#include<bits/stdc++.h>
using namespace std;
int b[12]={-1,1,7,4,2,6,8,10,18,22,20,28};
int c[7]={6,8,10,18,20,20,28};
int main()
{
	int n;
	cin>>n;
	while(n--)
	{
		int x;
		cin>>x;
		if(x<=12)cout<<b[x-1]<<endl;
		else
		{
			x-=12;
			int jj=x/7;
			int yy=x%7;
			if(x%7!=0)jj++;
			cout<<c[yy-1];
			if(yy-1==4)
			{
				cout<<0;
				jj--;
			}
			for(int i=1;i<=jj;i++)cout<<8;
			cout<<endl;
		}
	}
    return 0;
}
2024/11/1 18:01
加载中...