Created
April 29, 2014 09:50
-
-
Save dd1994/11395621 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void func(int); | |
int main(void) | |
{ | |
int n; | |
while(scanf("%d", &n) != EOF) | |
{ | |
func(n); | |
} | |
return 0; | |
} | |
void func(int n) | |
{ | |
int a[32], i, j; | |
i = n; | |
for(j = 0; i != 0; j++) | |
{ | |
a[j] = i % 2; | |
i /= 2; | |
} | |
for(j--; j>=0; j--) | |
{ | |
printf("%d", a[j]); | |
} | |
printf("\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://10.11.246.150/JudgeOnline/problem.php?cid=2005&pid=0