Sololearn C++ Ticket Office Problem
Here's the question: You are working on a ticketing system. A ticket costs $10. The office is running a discount campaign: each group of 5 people is getting a discount, which is determined by the age of the youngest person in the group. You need to create a program that takes the ages of all 5 people as input and outputs the total price of the tickets. Sample Input: 55 28 15 38 63 Sample Output: 42.5 This is my attempt #include <iostream> using namespace std; int main() { cout<<"Started >"; int ages[5]; for (int i = 0; i < 5; i++) { cin >> ages[i]; } //your code goes here int smallest = ages[0]; for (int x = 0; x < 5; x++) { /* code */ x=ages[x]; if (smallest>ages[x]) { /* code */ smallest=ages[x]; } } cout<<50-50*smallest/100<<endl; return 0; }