Skip to content
Snippets Groups Projects
Commit 4d846fb6 authored by Aladin Virmaux's avatar Aladin Virmaux
Browse files

vocabulaire struct_hard top -> cime

parent 7fa71bef
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ struct cerise {
struct cerisier {
cerise cerise_gauche;
int top;
int cime;
cerise cerise_droite;
};
......@@ -21,7 +21,7 @@ void initialise_cerise(cerise &miam, int val) {
}
void initialise_cerisier(cerisier &tree, int val) {
tree.top = val;
tree.cime = val;
initialise_cerise(tree.cerise_gauche, val - 2);
initialise_cerise(tree.cerise_droite, val + 2);
}
......@@ -35,6 +35,6 @@ int main() {
cerisier tree;
cin >> n;
initialise_cerisier(tree, n);
cout << tree.top + somme_cerise(tree.cerise_gauche) + somme_cerise(tree.cerise_droite) << endl;
cout << tree.cime + somme_cerise(tree.cerise_gauche) + somme_cerise(tree.cerise_droite) << endl;
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment