Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <QCoreApplication>
- #include <iostream>
- #include <stdio.h>
- #include <QDebug>
- #include <stdlib.h>
- using namespace std;
- const int i1=2;
- const int j1=2;
- int main(int argc, char *argv[])
- {
- QCoreApplication a(argc, argv);
- setlocale(LC_ALL, "Rus");
- int menu,i,j,p;
- int matr [i1][j1];
- qDebug () << "Меню: \n 1) Ввод цикла с квалиатуры; \n 2) Ввод цикла рандомом.";
- cin >> menu;
- switch (menu)
- {
- case 1:
- {
- for (i=0; i<i1; i++)
- {
- for (j=0; j<j1; j++)
- cin >> matr[i][j];
- break;
- }
- }
- case 2:
- {
- for (i=0; i<i1; i++)
- {
- for (j=0; j<j1; j++)
- matr[i][j] = rand(101)-50;
- }
- }
- break;
- }
- p = p+matr[i][j];
- cout << p;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement