About Me

About Me : I have been working as a Software Engineer for various international companies for four years.Currently, I am working as a full stack Javascript developer in Petronas(Malaysia).

Skills

Skills • Javascript •Typescript •Python •C •Java •ReactJs • Redux • VueJs • NestJs • React Testing Library • Django• PostgreSQL • MySQL • NodeJs • Git • Docker • Jira • Visual Studio Code • Slack

মঙ্গলবার, ১ সেপ্টেম্বর, ২০১৫

UVA :11933 - Splitting Numbers (way 2)

#include <bits/stdc++.h>
#define sc(a) scanf("%d",&a)
#define scd(a,b) scanf("%d%d",&a,&b)
#define sct(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define READ freopen ("input.txt","r",stdin)
#define nnn 20
using namespace std;

int main()
{
    int num;
    int a,b,c;
    // scanf("%d",&n);

    while(~sc(num)&&num)
    {
        a=b=c=0;
        for(int i=0; i<32; i++)
        {
            if((num&(1<<i)))
            {
                c++;
                if(c%2) a+=(1<<i);
                else b+=(1<<i);

            }

        }
        cout<<a<<" "<<b<<endl;
    }

    return 0;
}

কোন মন্তব্য নেই:

একটি মন্তব্য পোস্ট করুন