mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1263.cpp
This commit is contained in:
parent
3663826a89
commit
5320c6648f
29
QUSTOJ/1263.cpp
Normal file
29
QUSTOJ/1263.cpp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <bitset>
|
||||||
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int n,i;
|
||||||
|
string str;
|
||||||
|
while(cin>>n)
|
||||||
|
{
|
||||||
|
const int LEN=sizeof(int)*8;
|
||||||
|
bitset<LEN> a(n);
|
||||||
|
ostringstream p;
|
||||||
|
p<<a;
|
||||||
|
str=p.str();
|
||||||
|
int length=str.size();
|
||||||
|
for(i=0;i<length;i++)
|
||||||
|
{
|
||||||
|
if(str[i]!='0')
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cout<<str.c_str()+i<<endl;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user