题解 | 魔法棒

魔法棒

https://www.nowcoder.com/practice/976bd95dda8f4430b512d0c39bd9f106

#include<bits/stdc++.h>
using namespace std;

using ll=long long;
using ull=unsigned long long;
using i128=__int128_t;
using u128=__uint128_t;
using ld=long double;

void solve()
{
	ll x;//找规律 小于等于15的 只要能用3和8拼起来就可以 
	cin >> x;//15.16.17都能用3和8拼起来 那么以后的数只要在这三个数的基础上加n个3就能实现
	if(x!=2&&x!=3&&x!=5&&x!=6&&x!=8&&x!=11&&x!=14) cout << "Yes" << "\n";
	else cout << "No" << "\n";
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int t=1;
	cin >> t;
	
	while(t--)
	{
		solve();
	}
	return 0;
}

全部评论

相关推荐

点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务