Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int n, v[100];
- void read(int &n, int v[]) {
- cin >> n;
- for (int i = 0; i < n; i++) {
- cin >> v[i];
- }
- }
- void write(int n, int v[]) {
- for (int i = 0; i < n; i++) {
- cout << v[i] << ' ';
- }
- cout << endl;
- }
- int getMini(int n, int v[]) {
- int mini = v[0];
- for (int i = 1; i < n; i++) {
- if (mini > v[i]) {
- mini = v[i];
- }
- }
- return mini;
- }
- int main() {
- read(n, v);
- write(n, v);
- int mini = getMini(n, v);
- cout << mini << endl;
- for (int i = 0; i < n; i++) {
- if (mini == v[i]) {
- cout << i << ' ';
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement