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: 594 - One Little, Two Little, Three Little Endians

#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 n,res,pos,x;
    while(~sc(n))
    {
        res=pos=0;
        x=24;
        for(int i=1; i<=4; i++)
        {
            for(int j=x; j<x+8; j++)
            {
                if(n&(1<<j))
                {
                   res|=(1<<pos);

                }
                pos++;

            }
            x-=8;

        }
        printf("%d converts to %d\n",n,res);

    }

    return 0;
}

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

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