Skip to content

Commit 25026d1

Browse files
committed
Add std::cin cells to example notebooks
1 parent 7da2ddf commit 25026d1

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

notebooks/xeus-cpp-lite-demo.ipynb

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,10 @@
110110
"execution_count": 4
111111
},
112112
{
113-
"id": "ccf81e76-507a-42e5-9f83-99793f0eb46c",
114-
"cell_type": "code",
115-
"source": "# Interpreting the C++ programming language\n\nYou can define functions, classes, templates, etc ...",
116-
"metadata": {
117-
"trusted": true
118-
},
119-
"outputs": [],
120-
"execution_count": null
113+
"id": "a39c7021-ee9f-442e-8ea3-63ca23aa5d46",
114+
"cell_type": "markdown",
115+
"source": "# Interpreting the C++ programming language\n# You can define functions, classes, templates, etc ...",
116+
"metadata": {}
121117
},
122118
{
123119
"id": "e5b116ce-ced1-4aa4-b14e-ef7d2606202e",
@@ -577,9 +573,25 @@
577573
"execution_count": 28
578574
},
579575
{
580-
"id": "4557f440-c441-4f25-b461-9b4769f882a1",
576+
"id": "73aa865d-f643-4b72-9701-f6e312914690",
577+
"cell_type": "markdown",
578+
"source": "# Taking Standard Input from the user",
579+
"metadata": {}
580+
},
581+
{
582+
"id": "6efd2bbc-525a-4659-9431-aefc819e8cb7",
583+
"cell_type": "code",
584+
"source": "std::string name;\nstd::cin >> name;",
585+
"metadata": {
586+
"trusted": true
587+
},
588+
"outputs": [],
589+
"execution_count": null
590+
},
591+
{
592+
"id": "8ec65830-4cb5-4d01-a860-f6c46ac4f60f",
581593
"cell_type": "code",
582-
"source": "",
594+
"source": "std::cout << \"Your name is \" << name;",
583595
"metadata": {
584596
"trusted": true
585597
},

notebooks/xeus-cpp.ipynb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,27 @@
9595
"std::cerr << \"some error\" << std::endl;"
9696
]
9797
},
98+
{
99+
"cell_type": "code",
100+
"execution_count": null,
101+
"id": "e9140f55-e7c1-4122-992a-47e4f9f21bc2",
102+
"metadata": {},
103+
"outputs": [],
104+
"source": [
105+
"std::string name;\n",
106+
"std::cin >> name;"
107+
]
108+
},
109+
{
110+
"cell_type": "code",
111+
"execution_count": null,
112+
"id": "34189c4a-2941-4ac5-9992-d984aea57cda",
113+
"metadata": {},
114+
"outputs": [],
115+
"source": [
116+
"std::cout << \"Your name is\" << name;"
117+
]
118+
},
98119
{
99120
"cell_type": "code",
100121
"execution_count": 3,

0 commit comments

Comments
 (0)