unsigned long long div2(unsigned long long a){ unsigned long long ans = 0, i; for (i = 1; i <= a; i++) { if (i % 2){ continue; } else { ans++; } } return ans; }
- unsigned long long div2(unsigned long long a){
//Use binary operators...I-Oreturn a >> 1;- unsigned long long ans = 0, i;
- for (i = 1; i <= a; i++) {
- if (i % 2){
- continue;
- } else {
- ans++;
- }
- }
- return ans;
- }