- Notifications
You must be signed in to change notification settings - Fork 366
/
Copy patharray.cpp
35 lines (33 loc) · 468 Bytes
/
array.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include<bits/stdc++.h>
usingnamespacestd;
intmain(){
int n,m;
cin>>n>>m;
// char arr[n];
// for (int i = 0; i < n; ++i)
// {
// cin>>arr[i];
// }
// for (int i = 0; i < n; ++i)
// {
// cout<<arr[i];
// }
//2D array
int arr[n][m];
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < m; ++j)
{
cin>>arr[i][j];
}
}
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < m; ++j)
{
cout<<arr[i][j]<<"";
}
cout<<endl;
}
return0;
}