您的位置:首页 > 其它

【codevs 2975】与2,3,5无关的数

2015-10-22 10:53 399 查看
这题是搜索,是搜索,是搜索……

我不知道为啥tag是高精度……

手动读入练习题……

[code]#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cctype>
using namespace std;
int x,tot;
char c,b;
int main()
{
    while((c = getchar()) != EOF)
    {
        if(c == '.')
        {
            puts("No");
            return 0;
        }
        if(isdigit(c))
        {
            x += c - '0';
            x %= 3;
            b = c;
            tot++;
        }
    }
    c = b - '0';
    if(tot % 2 == 0)
        goto no;
    if(tot % 3 == 0)
        goto no;
    if(tot % 5 == 0)
        goto no;
    if(c % 2 == 0)
        goto no;
    if(!x)
        goto no;
    if(c % 5 == 0)
        goto no;
    puts("YeS");
    return 0;
    no:
        puts("No");
    return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: