+ 1

#include <iostream> using namespace std; int main() { int ages[5]; for (int i=0; i<5 ; ++i) { int min=ages[0

C++" ticket office " the code didnt work for me .. cn anyone help me .!

10th Feb 2021, 5:43 PM
Med Iheb Harbaoui
Med Iheb Harbaoui - avatar
5 Respostas
+ 1
#include <iostream> using namespace std; int main() { int ages[5]; for (int i=0; i<5 ; ++i) { int min=ages[0]; if (ages[i]<min) { min=ages[i]; }; cout << 50-50*min/100<< endl ; } return 0; }
10th Feb 2021, 6:20 PM
Med Iheb Harbaoui
Med Iheb Harbaoui - avatar
+ 1
int min=ages[0] should be before entering the for loop.
10th Feb 2021, 7:57 PM
Sonic
Sonic - avatar
+ 1
Maybe the cout statement needs to be outside and below the for loop?
10th Feb 2021, 7:57 PM
Sonic
Sonic - avatar
0
Please share your full code
10th Feb 2021, 5:50 PM
Atul [Inactive]
0
Here the hole code #Atul
10th Feb 2021, 6:20 PM
Med Iheb Harbaoui
Med Iheb Harbaoui - avatar