Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. using namespace std;
  4.  
  5. void showScr(int [][10],int,int *);
  6. void switchRows(int*[][10], int);
  7. void switchColumns(int *[][10], int);
  8.  
  9. int main()
  10. {
  11. int buffRows, x = 0, y = 0, key = 0, mainBuff[10][10] = { NULL },summ=0;
  12.  
  13. cout << "type a number of rows : ";
  14. cin >> buffRows;
  15. system("cls");
  16.  
  17. while (key!=pow(buffRows,2)){
  18. cout << "======TYPE A DATA======\n";
  19. key++;
  20. if (x == buffRows){
  21. x = 0;
  22. y++;
  23. }
  24. cout << "a[" << y + 1 << "][" << x + 1 << "] : ";
  25. cin >> mainBuff[y][x];
  26. cout << endl;
  27. x++;
  28. system("cls");
  29. }
  30. showScr(mainBuff, buffRows,&summ);
  31. cout << summ;
  32. _getch();
  33. return 0;
  34. }
  35.  
  36. void showScr(int massi[][10],int buff,int *summa)
  37. {
  38. for (int i = 0; i < buff; i++){
  39. for (int k = 0; k < buff; k++){
  40. if (massi[i][k] == 0)
  41. cout << " ";
  42. else {
  43. cout << massi[i][k] << ends;
  44. *summa += massi[i][k];
  45. }
  46. }
  47. cout << endl;
  48. }
  49. }
  50.  
  51. void switchRows(int *mass[][10], int rows)
  52. {
  53. for (int )
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement