You are not logged in. Please login at www.codechef.com to post your questions!

×

I've read that the following is the fastest method for accepting integers, can someone please tell me a little about its delimiters.

void fastscan(int &number) {

//variable to indicate sign of input number

bool negative = false;

register int c;



number = 0;



// extract current character from buffer

c = getchar();

if (c=='-')

{

    // number is negative

    negative = true;



    // extract the next character from the buffer

    c = getchar();

}

asked 07 Nov, 20:42

karan26122001's gravatar image

0★karan26122001
11
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,839
×401

question asked: 07 Nov, 20:42

question was seen: 161 times

last updated: 07 Nov, 20:42