kilolilo

Untitled

Feb 6th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void kv(int x,int y,int sh,int v,int X,int Y){
  6.     for (int i=14;i>=0;i--){
  7.         cout<<endl;
  8.         for (int j=0;j<14;j++){
  9.             if (j==X && i==Y ){
  10.                 cout<<"@ ";
  11.             }
  12.             else if(i==y+v && j>=x && j<=x+sh || i==y && j>=x && j<=x+sh || j==x && i>=y && i<=y+v || j==x+sh && i>=y && i<=y+v ) {
  13.                 cout<<"# ";
  14.             }
  15.             else {
  16.                 cout<<"  ";
  17.             }
  18.         }
  19.     }
  20. }
  21.  
  22. int main()
  23. {
  24.     int x,y,sh,v,X,Y;
  25.     x=1;
  26.     y=1;
  27.     sh=10;
  28.     v=10;
  29.     cin>>X>>Y;
  30.     if ((x<X && x+sh>X )&& (y+v>Y && y<Y) ){
  31.         cout<<"great";
  32.     }
  33.     else{
  34.         cout<<"bad";
  35.     }
  36.     kv(x,y,sh,v,X,Y);
  37. }
Add Comment
Please, Sign In to add comment