Created
May 20, 2013 15:22
-
-
Save pureexe/5612913 to your computer and use it in GitHub Desktop.
แปลงตัวอักษรเปนเลขฐาน2
This file contains hidden or 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> | |
| #include<string.h> | |
| #include<math.h> | |
| #include<stdlib.h> | |
| int main() | |
| { | |
| char word[200]; | |
| gets(word); | |
| char buff[20]; | |
| int i,x; | |
| for(i=0;i<strlen(word);i++){ | |
| itoa(word[i],buff,2); | |
| x=strlen(buff); | |
| while(x<8) | |
| { | |
| printf("0"); | |
| x++; | |
| } | |
| printf("%s\t",buff); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment