Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int L[101][101], m, n, i, j, st[101];
  5. int main()
  6. {
  7. cout<<"Dati nr linii: ";
  8. cin>>m;
  9. cout<<"Dati nr coloane: ";
  10. cin>>n;
  11. for(i=1;i<=m;i++)
  12. {
  13. for(j=1;j<=n;j++)
  14. {
  15. cout<<"Dati L["<<i<<"]["<<j<<"]: ";
  16. cin>>L[i][j];
  17. }
  18. }
  19. cout<<endl;
  20. cout<<endl;
  21. for(i=1;i<=m;i++)
  22. {
  23. for(j=1;j<=n;j++)
  24. cout<<L[i][j]<<" ";
  25. cout<<endl;
  26. }
  27. cout<<endl;
  28. cout<<endl;
  29. for(j=0;j<=n+1;j++)
  30. L[0][j]=-1;
  31. for(i=1;i<=m;i++)
  32. L[i][n+1]=-1;
  33. for(j=n+1;j>=0;j--)
  34. L[m+1][j]=-1;
  35. for(i=m;i>=1;i--)
  36. L[i][0]=-1;
  37. cout<<endl;
  38. cout<<endl;
  39. for(i=0;i<=m+1;i++)
  40. {
  41. for(j=0;j<=n+1;j++)
  42. cout<<setw(4)<<L[i][j];
  43. cout<<endl;
  44. }
  45. return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement