【NEEPU OJ】1006--This is a easy problem 4 U,2.

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34072526/article/details/88175385

描述

There is a theory about…

A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself.

First few prime numbers are:

2.3.5.7.11.13.17.19…

Your task is to find whether the summation of N-th and M-th prime number is even or odd.

For example , If the input is 2 and 4 then the 2nd and 4th prime number are 3 and 7, and sum is 3 + 7 = 10 .Here 10 is Even. So, the answer is Even.

if input is 1 and 2 then the prime number are 2 and 3,so 2 + 3 = 5 which is Odd.

输入

There are several test case and input will be terminated by end of file.Total number of test cases will not exceed 50.Each case contains two integers N and M(1 ≤ N , M ≤ 10^18) as described above.

输出

For each test case, print either "Even” (without quotes) or “Odd” (without quotes). If the summation of the N-th and M-th prime numbers is even then print “Even”, otherwise print “Odd”

输入样例 1

1 2
2 3

输出样例 1

Odd
Even

来源

Dev skill


代码

#include <cstdio>
using namespace std;

int main(){
    unsigned long long N, M;
    while(~scanf("%llu %llu", &N, &M)){
        if((N == 1 || M == 1) && N != M) puts("Odd");
        else puts("Even");
    }
    return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_34072526/article/details/88175385
今日推荐