C++ Primer(read the value you don’t know how many

陳威霖
Apr 14, 2021

If we can’t know how many numbers we need to calculate in advance.

we may use this: ******while(std::cin>>value) //if you input in CMD

it checks the space ******std::cin

It will keep counting until the value does not belong to the integer.

but if the number is floating it will treat as integer, plus it, then finished, didn’t count the rest of the value, although is an integer.

--

--

陳威霖

hi i am a student from Taiwan .My major is information management