initial commit
This commit is contained in:
18
C++/lesson3/task1.cpp
Normal file
18
C++/lesson3/task1.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
int a[10] = {11, 34, 32, 5, 86, 34, 123, 456, 148, 3456};
|
||||
int min = a[0];
|
||||
int max = a[0];
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (a[i] < min) {
|
||||
min = a[i];
|
||||
}
|
||||
if (a[i] > max) {
|
||||
max = a[i];
|
||||
}
|
||||
}
|
||||
std::cout << min << "\n";
|
||||
std::cout << max << "\n";
|
||||
}
|
Reference in New Issue
Block a user