ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1094. E-screen

And IV КАК читать пробелы в C++ [4] // Problem 1094. E-screen 3 Jul 2007 17:42
int a = getc(stdin);
read by simbol
DixonD (Lviv NU) Re: КАК читать пробелы в C++ [1] // Problem 1094. E-screen 3 Jul 2007 19:48
Before reading of spaces you must read rules of webboard! Speak in English!
AYUBXON UBAYDULLAYEV TUIT Re: КАК читать пробелы в C++ // Problem 1094. E-screen 12 Nov 2012 19:59
char ch;
while(cin.get(ch))
{

}
Виталий Черков Re: КАК читать пробелы в C++ // Problem 1094. E-screen 23 Mar 2015 21:18
можно вводить строку с пробелами целиком
для string s;
getline(cin, s);
можно вводить символ char ch;
ch = getchar();
эта штука позволяет вводить не только пробелы, но и символы перевода строк и прочее.
в основном, пользуюсь этими двумя способами.