Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <iostream>
- #include <iomanip>
- using namespace std;
- const int N = 3;
- void exchange(int a, int b, int* mass, int N, int M)
- {
- for (int i = 0; i < N; i++)
- {
- if ((mass[i] > a) && (mass[i] < b))
- mass[i] = 0;
- }
- }
- int main()
- {
- setlocale(LC_ALL, "Russian");
- cout << "Гришин К.А. УМЛ-111 3 вариант\n";
- int a;
- int b;
- int x[N][M];
- cout << "A= ";
- cin >> a;
- cout << "B= ";
- cin >> b;
- for (i = 0; i < N; i++)
- {
- for (j = 0; j < M; j++)
- {
- cin >> [i][j];
- cout << setw(6) << left << x[i][j];
- } cout << endl;
- }
- for (int i = 0; i < N; i++)
- {
- exchange(a, b, x, N, M);
- }
- cout << endl;
- for (int i = 0; i < N; i++)
- {
- for (int j = 0; j<M; j++)
- {
- cout << setw(4) << x[i][j] << " ";
- }
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment