Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int n , m;
  8. cout << "n=";
  9. cin >> n;
  10. cout << "m=";
  11. cin >> m;
  12. int *b = new int[m];
  13. for (int i = 0; i < m; ++i)
  14.  
  15. {
  16. b[i] = 0;
  17.  
  18. }
  19.  
  20. int **a = new int *[n];
  21. for (int i = 0; i < n; ++i)
  22.  
  23. {
  24. for (int j = 0; j < n; ++j)
  25.  
  26. {
  27. a[i] = new int[n];
  28. }
  29.  
  30. }
  31.  
  32. for (int i = 0; i < n; ++i)
  33.  
  34. {
  35. for (int j = 0; j < n; ++j)
  36.  
  37. {
  38. cin >> a[i][j];
  39.  
  40. }
  41.  
  42.  
  43. }
  44.  
  45. for (int j= 0; j < n; ++j)
  46.  
  47. { for (int i = 0; i < n; ++i)
  48.  
  49. {
  50. if (a[i][j] > -1)
  51.  
  52. {
  53. a[i][j] = b[i];
  54.  
  55. break;
  56. }
  57.  
  58. cout << b[i];
  59.  
  60. }
  61.  
  62. }
  63.  
  64. system("pause");
  65. return 0;
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement