题解 | #小美的因子查询#

小美的因子查询

https://www.nowcoder.com/practice/1870e68256794c6aa727c8bb71fd9737

判断n是否模2为0即可。

#include<bits/stdc++.h>
#define int long long
#define double long double
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef long long ll;
typedef pair<int, int> PII;
const int N = 3e5 + 10;
const int M = 1e3 + 10;
int mod = 1e9 + 7;
int a[N];
int cal(string s) {
    int ans = 0;
    for (int i = 0; i < s.size(); i++) ans = ans * 10 + s[i] - '0';
    return ans;
}

void solve() {
    int n;
    cin >> n;
    if (n % 2 == 0) cout << "YES\n";
    else cout << "NO\n";
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int _;
    _ = 1;
    cin >> _;
    while (_--) {
        solve();
    }
}

全部评论

相关推荐

Sigma429:极兔啊,薪资开的巨低,还在上海,索性不做笔试了
点赞 评论 收藏
分享
迷茫的大四🐶:看来已经准备换人了
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务