Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
- typedef long long ll;
- int main()
- {
- fast();
- int n,sum=0,x;
- cin>>n;
- x=n;
- while(n>0)
- {
- sum+=(n%10);
- n/=10;
- }
- //cout<<sum<<endl;
- if(sum%4==0)
- cout<<x<<endl;
- else
- {
- while(1)
- {
- x+=1;
- n=x;
- sum=0;
- while(n>0)
- {
- sum+=(n%10);
- n/=10;
- }
- //cout<<sum<<endl;
- if(sum%4==0)
- {
- cout<<x<<endl;
- return 0;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement