A
A
Alexander Bagirov2015-12-14 18:19:28
C++ / C#
Alexander Bagirov, 2015-12-14 18:19:28

How to count a string quickly?

There is a long string (up to 10^7 characters). How can it be quickly read from the console?
The cin option doesn't work. Preferably scanf or gets , but I'll take note of all the options.
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
MiiNiPaa, 2015-12-14
@alexbagirov

Why doesn't cin fit? Just do not say that slow, block reading after decoupling from C-streams is faster than scanf.
You can read about comparisons of input methods: habrahabr.ru/post/246257

L
LittleFatNinja, 2015-12-14
@LittleFatNinja

scanf();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question