hdu 2051 Bitset 把一個十進位制轉化為2進位制數

NO IMAGE

Give you a number on base ten,you should output it on base two.(0 < n < 1000)

InputFor each case there is a postive number n on base ten, end of file.
OutputFor each case output a number on base two.
Sample Input

1
2
3

Sample Output

1
10
11

itoa函式可以吧十進位制傳話為2或8或16進位制等

//
//  main.cpp
//  160929
//
//  Created by 劉哲 on 17/4/13.
//  Copyright © 2016年 my_code. All rights reserved.
//
//#include <bits/stdc  .h>
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <list>
#include <bitset>
#include <stack>
#include <stdlib.h>
#define lowbit(x) (x&-x)
using namespace std;
int main()
{
int n;
while(cin>>n){
char s[10];
itoa(n,s,2);
cout<<s<<endl;
}
return 0;
}