Kattis - Oddities 發表於 2021-03-23 分類於 Kattis 閱讀次數: Kattis - Oddities題目https://hackmd.io/@sa072686/Kattis_oddities https://open.kattis.com/problems/oddities 判斷 $n$ 是奇數或是偶數 Code123456789101112131415//By Koios1143#include<iostream>using namespace std;int main(){ int n,x; cin>>n; while(n--){ cin>>x; if(x%2==0) cout<<x<<" is even\n"; else cout<<x<<" is odd\n"; } return 0;} 複雜度分析總時間複雜度為 $O(1)$