Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
jupyter:
jupytext:
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: C++17
language: C++17
name: xcpp17
---
### Objectif pédagogique : comprendre la difference entre valeur et nom d'une variable de type string
```{code-cell} c++
---
editable: false
tags: [hide-cell]
---
#include <iostream>
#include "jupyter_exercizer_helpers.hpp"
using namespace std;
```
+++
```{code-cell} c++
---
tags: [hide-cell, variable]
---
CONST NAMEstr = RANDOM_CHOICE("Bob", "Barbara", "Pierre", "Paul", "Jeanne", "Camille");
NAMEstr
```
+++
```{code-cell} c++
---
tags: [hide-output, substitution]
---
string NAME = NAMEstr;
string r = NAME;
```
+++
:::{admonition} Consigne
Quelle est la valeur attendue de `r`?
:::
```{code-cell}
---
editable: true
nbgrader:
grade: false
grade_id: init
locked: false
schema_version: 3
solution: true
---
string result = INPUT(
/// BEGIN SOLUTION
NAMEstr
/// END SOLUTION
);
```
+++
```{code-cell}
---
editable: false
nbgrader:
grade: true
grade_id: check
locked: true
points: 1
schema_version: 3
solution: false
tags: [hide-cell]
---
CHECK( result == r );
```