Skip to content

Commit a0b21c5

Browse files
authored
Add std::cin cells to example notebooks (#329)
1 parent 84b0619 commit a0b21c5

File tree

2 files changed

+48
-15
lines changed

2 files changed

+48
-15
lines changed

notebooks/xeus-cpp-lite-demo.ipynb

Lines changed: 23 additions & 11 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,14 +573,30 @@
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 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
},
586598
"outputs": [],
587599
"execution_count": null
588600
}
589601
]
590-
}
602+
}

notebooks/xeus-cpp.ipynb

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,16 +842,37 @@
842842
]
843843
},
844844
{
845-
"cell_type": "code",
846-
"execution_count": null,
847-
"id": "8e61d038-c7a6-4796-a6c6-d70c34ecd724",
845+
"cell_type": "markdown",
846+
"id": "92b12afd-2dbd-41df-acd0-25171c6dbb0d",
848847
"metadata": {
849848
"vscode": {
850849
"languageId": "c++"
851850
}
852851
},
852+
"source": [
853+
"# Taking input from the user"
854+
]
855+
},
856+
{
857+
"cell_type": "code",
858+
"execution_count": null,
859+
"id": "e9a85de0-df46-4850-b88a-4b752f29c1a4",
860+
"metadata": {},
853861
"outputs": [],
854-
"source": []
862+
"source": [
863+
"std::string name;\n",
864+
"std::cin >> name;"
865+
]
866+
},
867+
{
868+
"cell_type": "code",
869+
"execution_count": null,
870+
"id": "f95eece8-cd43-443e-8e27-9b901afefb20",
871+
"metadata": {},
872+
"outputs": [],
873+
"source": [
874+
"std::cout << \"Your name is\" << name;"
875+
]
855876
}
856877
],
857878
"metadata": {

0 commit comments

Comments
 (0)