Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int main(void)
- {
- int x;
- char ch;
- char digits[20];
- int i;
- x = 0;
- while ((ch=getchar()) != EOF && isdigit(ch)) {
- x = x*10+ch-'0';
- }
- x = x*2 ;
- i = 0;
- while (x>0) {
- digits[i] = (x%10) + '0';
- x = x / 10;
- i++;
- }
- i--;
- while (i>=0) {
- putchar(digits[i]);
- putchar('_');
- i--;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement