forked from newde/homework
上传文件至「666」
This commit is contained in:
27
666/01.cpp
27
666/01.cpp
@@ -1,22 +1,17 @@
|
|||||||
#include<iostream>
|
#include<iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
|
int a[8];
|
||||||
int t=0;
|
int i;
|
||||||
int h=0;
|
cin>>i;
|
||||||
|
for(int j=0;j<8;j++){
|
||||||
while(h<=17){
|
a[j]=i%2;
|
||||||
t++;
|
i=i/2;
|
||||||
h+=3;
|
cout<<a[j];
|
||||||
|
|
||||||
if(h>=17)
|
|
||||||
break;
|
|
||||||
|
|
||||||
t++;
|
|
||||||
h--;
|
|
||||||
}
|
}
|
||||||
|
cout<<endl;
|
||||||
cout<<"需要"<<t<<"分钟"<<endl;
|
for(int b=7;b>=0;b--)
|
||||||
|
cout<<a[b];
|
||||||
|
cout<<endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user