BestCoder Round #64 1001
Numbers
There is a number N.You should output "YES" if N is a multiple of 2, 3 or 5,otherwise output "NO".
There are multiple test cases, no more than 1000 cases. For each case,the line contains a integer N.(0< N<{10}^{30})(0<N<1030)
For each test case,output the answer in a line.
2
3
5
7
YES
YES
YES
NO 这个没必要再说了吧,,
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x3fffffff
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
using namespace std;
int main()
{
char s[100000];
int i;
__int64 sum;
int ans;
int len;
while(cin>>s)
{
sum=0;
len=strlen(s);
for(i=0;i<len;i++)
{
sum+=(s[i]-'0');
}
ans=s[len-1]-'0';
if(ans%2==0||s[len-1]=='5'||sum%3==0)
{
cout<<"YES"<<endl;
}
else
{
cout<<"NO"<<endl;
}
}
return 0;
}
BestCoder Round #64 1001的更多相关文章
- 贪心 BestCoder Round #39 1001 Delete
题目传送门 /* 贪心水题:找出出现次数>1的次数和res,如果要减去的比res小,那么总的不同的数字tot不会少: 否则再在tot里减去多余的即为答案 用set容器也可以做,思路一样 */ # ...
- (BestCoder Round #64 (div.2))Array
BestCoder Round #64 (div.2) Array 问题描述 Vicky是个热爱数学的魔法师,拥有复制创造的能力. 一开始他拥有一个数列{1}.每过一天,他将他当天的数列复制一遍,放在 ...
- 暴力 BestCoder Round #41 1001 ZCC loves straight flush
题目传送门 /* m数组记录出现的花色和数值,按照数值每5个搜索,看看有几个已满足,剩下 5 - cnt需要替换 ╰· */ #include <cstdio> #include < ...
- 暴力 BestCoder Round #46 1001 YJC tricks time
题目传送门 /* 暴力:模拟枚举每一个时间的度数 详细解释:http://blog.csdn.net/enjoying_science/article/details/46759085 期末考结束第一 ...
- 字符串处理 BestCoder Round #43 1001 pog loves szh I
题目传送门 /* 字符串处理:是一道水题,但是WA了3次,要注意是没有加'\0'的字符串不要用%s输出,否则在多组测试时输出多余的字符 */ #include <cstdio> #incl ...
- BestCoder Round #75 1001 - King's Cake
Problem Description It is the king's birthday before the military parade . The ministers prepared a ...
- ACM学习历程—HDU5585 Numbers(数论 || 大数)(BestCoder Round #64 (div.2) 1001)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5585 题目大意就是求大数是否能被2,3,5整除. 我直接上了Java大数,不过可以对末尾来判断2和5, ...
- BestCoder Round #92 1001 Skip the Class —— 字典树 or map容器
题目链接:http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=748&pid=1001 题解: 1.trie树 关 ...
- BestCoder Round #61 1001 Numbers
Problem Description There are n numbers A1,A2....An{A}_{1},{A}_{2}....{A}_{n}A1,A2....An,yo ...
随机推荐
- 下拉菜单控件JComboBox的使用
---------------siwuxie095 工程名:TestUI 包名:com.siwuxie095.ui 类名:TestList.ja ...
- ThinkPHP的URL模式
ThinkPHP的URL模式有四种,默认是PATHINFO模式,其他三种分别为:普通模式.REWRITE和兼容模式. 一.PATHINFO模式 浏览器输入格式为: http://localhost/d ...
- 杭电acm 1021题
题意是要求能被3整除的数所以为了避免大数据的产生,直接对每个数据求余,然后相加 #include "iostream" using namespace std; int main( ...
- 每日一Git计划启动
效仿某大神,每日一Git,初次启动,维时30天 规范: 1. 不能提交纯属搞笑灌水的 2. 可以提交ACM题目代码 3. 想不到了..靠自觉的东西,对自己有提升的就做,没提升纯属刷数据的就不算吧.. ...
- python的远程调试(使用pycharm)
测试环境描述1:c++调用python,操作系统环境是linux 2:pycharm安装在windows 安装步骤 1:把pycharm-debug.egg上传到linux上面. 2:使用easy_i ...
- android smali代码注入 实战一
有同学在通服里面干活,最近一直忙着4g基站搭建的干活,测试设备(android)测量移动网络数据,没有自动保存记录的功能,只能手动记录各种测试参数,不知道测试软件供应商是怎样想的,竟然不提供的这样的功 ...
- sizeof的用法与字节对齐
一.sizeof是什么? sizeof是一种预编译处理,不是函数,不是一元表达式.也即,作用阶段在编译期. 二.功能是什么? sizeof返回变量或类型的字节数. 三.调用方式 sizeof(obje ...
- maven-排除传递依赖-exclusions
在maven项目中引用dubbo的maven依赖的时候会引入dubbo中传递依赖的spring的依赖包如下: <!-- dubbo相关的jar包 --> &l ...
- Microsoft.Baidu.Ali.语音识别/人脸识别
在第一篇博客里提过图片识别的底层.最精准的图片识别需要海量的数据磨炼.自己写的底层没有以亿为单位的数据支持其实也是个残废品. 此篇不是为了教学.而且在需要的时候抄下来就能用 在此介绍Microsoft ...
- vue 项目接口管理
在vue开发中,会涉及到很多接口的处理,当项目足够大时,就需要定义规范统一的接口,如何定义呢? 方法可能不只一种,本文使用axios+async/await进行接口的统一管理. 本文使用vue-cli ...