Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <clocale>
- using namespace std;
- int main() {
- setlocale(LC_ALL, "Rus");
- int A[10][12], i, j;
- for (i = 0; i < 10; i++) {
- cout << endl;
- if (i == 5) {
- cout << endl;
- }
- for (j = 0; j < 12; j++) {
- A[i][j] = rand() % 100 - 50;
- cout << A[i][j]<<' ';
- }
- }
- cout << endl;
- int q = 0;
- for (i = 6; i < 12; i++) {
- for (j = 0; j < 12; j++) {
- if (A[i][j] > 0) {
- q++;
- }
- }
- }
- cout << q << endl;
- int B[6], q1 = 0;
- for (j = 0; j < 12; j += 2) {
- q1 = 0;
- for (i = 0; i < 10; i++) {
- if (A[i][j] < 0) {
- q1++;
- }
- }
- cout << " " << q1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment