Advertisement
Guest User

Untitled

a guest
May 27th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. void fastscan(int &number)
  2. {
  3. bool negative = false;
  4. register int c;
  5.  
  6. number = 0;
  7. c = getchar();
  8. while(c == ' ' || c== '\n')
  9. c = getchar();
  10. if (c == '-')
  11. {
  12. negative = true;
  13. c = getchar();
  14. }
  15. if(c == '+')
  16. c = getchar();
  17.  
  18. for (; (c > 47 && c < 58); c = getchar())
  19. number = number *10 + c - 48;
  20.  
  21. if (negative)
  22. number *= -1;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement