Shawn's Blog

  • Home
  • Tags
  • Categories
  • Archives
  • Search
  • Table of Contents
  • Overview

Shawn

若有恒,何必三更眠五更起;最无益,莫过一日曝十日寒。
392 posts
13 categories
114 tags

AcWing 3547. 特殊数字

Posted on 2021-05-29 Edited on 2024-11-24 In AcWing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;
int n;
bool check(int n) {
int ans = 0;
while (n) {
ans += n % 10;
n /= 10;
}
return ans % 4 == 0;
}

int main() {
cin >> n;
while (!check(n)) ++n;
cout << n << endl;
return 0;
}
AcWing 3548. 双端队列
LeetCode 1879. Minimum XOR Sum of Two Arrays
© 2024 Shawn
Powered by Hexo & NexT.Mist
0%