美文网首页
CodeFoeces-959A

CodeFoeces-959A

作者: ss5smi | 来源:发表于2018-04-10 16:56 被阅读0次

题目

原题链接:A. Mahmoud and Ehab and the even-odd game

题意

给定一个数字n,由Mahmoud开始他必须选一个1≤a≤n且为偶数,而Ehab必须选一个1≤a≤n且为奇数。随后从n中减去该数字。选不出数字为止。问谁会赢。

代码

#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin>>n;
    if(n%2==0) printf("Mahmoud\n");
    else printf("Ehab\n");
    return 0;
}

相关文章

  • CodeFoeces-959A

    题目 原题链接:A. Mahmoud and Ehab and the even-odd game 题意 给定一个...

网友评论

      本文标题:CodeFoeces-959A

      本文链接:https://www.haomeiwen.com/subject/iutpcftx.html