华东交通大学2016年ACM“双基”程序设计竞赛 1001

Problem Description

输入一个非负的int型整数,是奇数的话输出"ECJTU",是偶数则输出"ACM"。

Input

多组数据,每组数据输入一个x。
输入到文件结尾结束(scanf函数返回值不为EOF时),例如:
#include<cstdio>
using namespace std;
int main()
{
int x;
while (scanf("%d", &x)!=EOF) {
if (x%2==1) printf("... ");
else printf("... ");
}
  return 0;
}

Output

每组输出数据占一行。

Sample Input

1
2

Sample Output

ECJTU
ACM

Author

zhengjinke2123
解法:没什么好说的
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x3fffffff
#define INF 0x3f3f3f3f
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define ULL unsigned long long
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        if(n%2==0)
        {
            cout<<"ACM"<<endl;
        }
        else
        {
            cout<<"ECJTU"<<endl;
        }
    }
    return 0;
}

  

原文地址:https://www.cnblogs.com/yinghualuowu/p/6084460.html