Lesson 3 of 24
cin और getline से Input
8 min 20 XP
cin >> x space या नई लाइन तक एक value पढ़ता है। Spaces वाली पूरी लाइन के लिए getline(cin, s) लें। cin >> के बाद getline से पहले cin.ignore() call करें ताकि बचा हुआ newline छूट जाए।
Example: edit me and press Run
Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.