Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int L[101][101], m, n, i, j, st[101];
- int main()
- {
- cout<<"Dati nr linii: ";
- cin>>m;
- cout<<"Dati nr coloane: ";
- cin>>n;
- for(i=1;i<=m;i++)
- {
- for(j=1;j<=n;j++)
- {
- cout<<"Dati L["<<i<<"]["<<j<<"]: ";
- cin>>L[i][j];
- }
- }
- cout<<endl;
- cout<<endl;
- for(i=1;i<=m;i++)
- {
- for(j=1;j<=n;j++)
- cout<<L[i][j]<<" ";
- cout<<endl;
- }
- cout<<endl;
- cout<<endl;
- for(j=0;j<=n+1;j++)
- L[0][j]=-1;
- for(i=1;i<=m;i++)
- L[i][n+1]=-1;
- for(j=n+1;j>=0;j--)
- L[m+1][j]=-1;
- for(i=m;i>=1;i--)
- L[i][0]=-1;
- cout<<endl;
- cout<<endl;
- for(i=0;i<=m+1;i++)
- {
- for(j=0;j<=n+1;j++)
- cout<<setw(4)<<L[i][j];
- cout<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement