Subscribe Us

Responsive Advertisement

Advertisement

1183A Nearest Interesting Number codeforces solution in

 1183A Nearest Interesting Number codeforces solution in cpp

by ujjal roy




#include<bits/stdc++.h>

using namespace std;

main()

{

    int a,n,i,sum=0,r;

    cin>>a;

    for(i=1;1;i++)

    {

        sum=0;

        n=a;

     while(n!=0)

    {

        r=n%10;

        sum+=r;

        n/=10;

    }

    if(sum%4==0)

    {

        cout<<a<<endl;

        break;

    }

     a++;


    }

    return 0;

}


Post a Comment

0 Comments