CPP
cpp
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
#include <iostream>
using namespace std;
const int arraySize = 6;
void inicialize_f(int matrix[], int arraySize){
int index;
for(index = 0; index < arraySize; index++)
cin >> matrix[index];
}
int printArray(int matrix[], int arraySize){
int index;
int minIndex = matrix[0];
for(index = 0; index < arraySize; index++)
if(minIndex > matrix[index])
minIndex = matrix[index];
return minIndex;
}
int main() {
int ages[arraySize] = {55, 34, 3, 23, 9, 15};
int prize_perPerson = 10;
inicialize_f(ages, arraySize);
cout << "Najmansi element v nizu = " << printArray(ages, arraySize) << endl;
int minIndex1 = printArray(ages, arraySize);
cout << minIndex1 << endl;
double discount = minIndex1/100.0;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run