Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- void showScr(int [][10],int,int *);
- void switchRows(int*[][10], int);
- void switchColumns(int *[][10], int);
- int main()
- {
- int buffRows, x = 0, y = 0, key = 0, mainBuff[10][10] = { NULL },summ=0;
- cout << "type a number of rows : ";
- cin >> buffRows;
- system("cls");
- while (key!=pow(buffRows,2)){
- cout << "======TYPE A DATA======\n";
- key++;
- if (x == buffRows){
- x = 0;
- y++;
- }
- cout << "a[" << y + 1 << "][" << x + 1 << "] : ";
- cin >> mainBuff[y][x];
- cout << endl;
- x++;
- system("cls");
- }
- showScr(mainBuff, buffRows,&summ);
- cout << summ;
- _getch();
- return 0;
- }
- void showScr(int massi[][10],int buff,int *summa)
- {
- for (int i = 0; i < buff; i++){
- for (int k = 0; k < buff; k++){
- if (massi[i][k] == 0)
- cout << " ";
- else {
- cout << massi[i][k] << ends;
- *summa += massi[i][k];
- }
- }
- cout << endl;
- }
- }
- void switchRows(int *mass[][10], int rows)
- {
- for (int )
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement