Advertisement
Leonard_M

macroul

Mar 25th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     char char_array[128];
  6.     int i = 0, ch, sum = 0;
  7.  
  8.     while(true){
  9.         ch = getchar();
  10.         if(ch == '\n')
  11.             break;
  12.         sum = sum * 10 + (ch - '0');
  13.     }
  14.  
  15.     printf("%d", sum);
  16.  
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement