Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int A[5][6];
- int Wr ( int N, int M ) {
- for ( int i = 1 ; i < N + 1 ; i ++ )
- {
- for ( int j = 1 ; j < M + 1 ; j ++ ) {
- cout << "If there is a start point here, press 0" << endl ;
- cout << "IF there is a easy go point, press 1" << endl ;
- cout << "If there is an obstacle, press 2" << endl ;
- cout << "If there is end point, press 3" << endl ;
- int cell_;
- cin>>cell_;
- if (cell_==0)
- A[i][j]=0;
- if (cell_==1)
- A[i][j]=N*M;
- if (cell_==2)
- A[i][j]=-1;
- if (cell_==3)
- A[i][j]=-2;
- }
- }
- for (int i=0; i<N+2; i++){
- A[0][i]=-1;
- A[N+1][i]=-1;
- A[i][0]=-1;
- A[i][M+1]=-1;
- }
- }
- void Wave(int a, int b, int c, int d, int n){
- A[a][b]=n;
- }
- int main()
- {
- Wr(3, 4);
- for (int i=0; i<5; i++) {
- for (int j=0; j<6; j++)
- std::cout << " " << A[i][j];
- std::cout << std::endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement