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

×

In C/C++, how should I read/write long longs?

How can i write long longs in C/C++?

asked 10 Apr '13, 14:27

anup's gravatar image

2★anup ♦♦
2.2k263943
accept rate: 23%

edited 10 Apr '13, 15:59

admin's gravatar image

0★admin ♦♦
19.6k349497539


Some compilers, such as Dev-C++, require you to use %I64d with scanf/printf. However, for your code to work on Codechef, use %lld instead.

link

answered 10 Apr '13, 14:27

admin's gravatar image

0★admin ♦♦
19.6k349497539
accept rate: 35%

Or simply use cout.

Along with the line std::ios_base::sync_with_stdio(false); at the beginning of main to speed up cout/cin

link

answered 10 Apr '13, 19:09

ishanbhatnagar's gravatar image

5★ishanbhatnagar
8502614
accept rate: 21%

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,887
×1,466
×206

question asked: 10 Apr '13, 14:27

question was seen: 7,094 times

last updated: 10 Apr '13, 19:09