Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int n_a; int n_b;
- int poslidovn(double mass_a[], double mass_b[], int i)
- {
- double max1 = mass_a[0];
- for (int i = 0; i < n_a; i++)
- {
- if (i > 3)
- {
- if (max1 < mass_a[i])
- max1 = mass_a[i];
- if (mass_a[i] == max1)
- mass_a[i] = 0.5;
- }
- cout << mass_a[i] << " ";
- }
- double max2 = mass_b[0];
- for (int i = 0; i < n_b; i++)
- {
- if (i>3)
- {
- if (max2 < mass_b[i])
- max2 = mass_b[i];
- if (mass_b[i] == max2)
- mass_b[i] = 0.5;
- }
- cout << mass_b[i] << " ";
- }
- return(0);
- }
- //void poslidovn(double mass_a[], double mass_b[], int i);
- int main()
- { double mass_a[100], mass_b[100];
- int i = 0;
- do
- {
- cout << "Vvedit' kilkist' elementiv poslidovnosti а i b (max - 100): \n";
- cin >> n_a >> n_b;
- } while (n_a < 1 || n_a > 100 || n_b < 0 || n_b > 100);
- cout << "VVedit' poslidovnost' cifr (" << n_a << "elementiv) а: \n";
- for (int i = 0; i < n_a; i++)
- cin >> mass_a[i];
- cout << "VVedit' poslidovnosti cifr (" << n_b << " elementiv) b: \n";
- for (int i = 0; i < n_b; i++)
- cin >> mass_b[i];
- i = 0;
- poslidovn(mass_a, mass_b, i);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement