3746 - 判断3的倍数

判断一个数是不是3的倍数,如果是打印yes,否则打印no

题目输入

一行,一个整数

题目输出

一行,yes或者no

输入/输出样例

题目输入

3

题目输出

yes

C++解答

#include <iostream> 
#include <cstdio>
using namespace std;
int main()
{
	int x;
	cin>>x;
	if(x%3 == 0)
	{
		cout<<"yes"<<endl;
	}
	else
	{
		cout<<"no"<<endl;
	}
	return 0;
}
时间限制 1 秒
内存限制 128 MB
讨论 统计
上一题 下一题