ZJANS

e598. 傑出校友表揚

Easy Last Update: 2026/01/14
cpp

解法一

✅ 完整代碼

評分結果(參考) : AC (2ms, 348KB)

#include<bits/stdc++.h>
using namespace std;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int num;
    cin >> num;
    string ans = "yes";
    
    int k[] = {2, 3, 5, 7};
    int a = num/100000000;
    
    for(int i : k){
        if(a < i) break;
        if(num%i == 0){
            ans = "no";
            break;
        }
    }
    cout << ans;
    
    return 0;
}