首页 > 其他分享 >111

111

时间:2023-08-08 20:44:17浏览次数:44  
标签:int demo h1 maxH 111 maxL l1

#include <bits/stdc++.h>
using namespace std;
int maxH = 8,maxL = 8,l = maxH/2,h = maxL/2;
void v(int h1,int l1){
    for(int i = 0;i<maxH;i++){
        for(int j = 0;j<maxL;j++){
            if(i==h && j==l){
                cout<<setw(3)<<"A";
            }else if(i==h1 && j==l1){
                cout<<setw(3)<<"B";
            }else{
                cout<<setw(3)<<".";
            }
        }
        cout<<endl;
    }
}
int main(){
    srand(time(0));
    int h1 = rand()%8,l1 = rand()%8;
    char a;
    while(1){
        v(h1,l1);
        cout<<"请输入方向 (w,a,s,d)"<<endl;
        cin>>a;
        if(a=='a'){
            l--;
            if(l-1<0){
                l = 0;
            }
            if(l==l1 && h==h1){
                l1--;
            }
        }else if(a=='d'){
            l++;
            if(l+1>maxH){
                l = maxL-1;
            }
            if(l==l1 && h==h1){
                l1++;
            }
        }else if(a=='w'){
            h--;
            if(h-1<0){
                h = 0;
            }
            if(h==h1 && l==l1){
                h1--;
            }
        }else if(a=='s'){
            h++;
            if(h+1>maxH){
                h = maxH-1;
            }
            if(h==h1 && l==l1){
                h1++;
            }
        }
        if(l1<0 || l1+1>maxL || h1<0 || h1+1>maxH){
            system("cls");
            v(h1,l1);
            break;
        }
        system("cls");
    }
    return 0;
}

https://demo.lanrenzhijia.com/demo/55/5518/demo/

标签:int,demo,h1,maxH,111,maxL,l1
From: https://www.cnblogs.com/wangyihang-xh/p/17615329.html

相关文章

  • [err] 1118 Row size too large.
      一个工单表字段多+个别字段使用较长(上千)varchar,导致err1118 解决是将这些超长varchar转换为text,注意MBG生成的mapper会有变化这种业务数据量逐年增长,表字段不断增加。可采取冷热数据分离(横向分表,业务分隔),业务字段分离(纵向分表,关联查询) https://dev.mysql.com......
  • 1111
    redis的配置sudocat/etc/redis/redis.confredis安装成功以后,window下的配置文件保存在软件安装目录下,如果是mac或者linux,则默认安装/etc/redis/redis.conf3.2.1redis的核心配置选项redis与mysql类似,也是C/S架构的软件,所以存在客户端和服务端,默认的redis的服务端时re......
  • oracle数据库临时表空间损坏,报错ORA-01116,ORA-01110 ,ORA-27041,ORA-06512的解决方式
     打脚本的时候报错:ORA-01116:打开数据库文件203时出错ORA-01110:数据文件203:'/u01/app/oracle/oradata/temp02.dbf'ORA-27041:无法打开文件Linux-x86_64Error:2:NosuchfileordirectoryAdditionalinformation:3ORA-06512:在line9  是我们环境的临时表空间......
  • 111
    classfocal_pixel_learning(torch.nn.Module):def__init__(self):super().__init__()self.alpha_sp,self.gamma_sp=1,0.5self.alpha_lp,self.gamma_lp=1,1self.upscale_func=functools.partial(F.interpolate,mode=�......
  • 111
    苹果地格式化:http://3ms.huawei.com/km/groups/5061/blogs/details/12905165http://3ms.huawei.com/hi/group/1004715/thread_9062575.html?mapid=10892997&t_type=ask https://w3.huawei.com/amtracking/eam/web/login/forwardMain.do 便携机AppleMacBookPro2018新In......
  • 111.在进行函数参数以及返回值传递时,可以使用引用或者值传递,其中使用引用的好处有哪
    111.在进行函数参数以及返回值传递时,可以使用引用或者值传递,其中使用引用的好处有哪些?对比值传递,引用传参的好处:1)在函数内部可以对此参数进行修改2)提高函数调用和运行的效率(因为没有了传值和生成副本的时间和空间消耗)如果函数的参数实质就是形参,不过这个形参的作用域只是在函......
  • P1115 最大子段和 一维动态规划
    #include<iostream>#include<cmath>usingnamespacestd;longlongn,a[200005],dp[200005],ans;intmain(){cin>>n;for(inti=1;i<=n;i++){cin>>a[i];}dp[1]=a[1];ans=a[1];for(inti=2;i<......
  • 111
    # 模型服务ws代理server {        listen       7502;        server_name  localhost;                location ~ ^/b(\d*)m(\d*)e([\w]*) {                #proxy_pass http://10.0.125.70:$1$2;      ......
  • django python manage.py migrate 后报错字段长度超了 django.db.utils.OperationalE
     现象:在models.py将CharField字段的maxlength=修改后,执行ythonmanage.pymigrate 报错django.db.utils.OperationalError:(1118 'Rowsizetoolarge.Themaximumrowsizefortheusedtabletype,notcountingBLOBs,is65535.Thisincludes storageoverhead,c......
  • cellos.20221115_030623类似的目录撑爆存储节点的root文件系统
    1、某Exadata客户,其中一个存储节点的根文件系统使用率超过90%,使用如下命令检查是哪些目录占用空间#du-sm*|sort-rn|head发现是/var/log目录下的东西占用大量空间。2、在/var/log目录下,存在大量cellos开头,但以日期结果的目录,这些目录占用大量磁盘空间。如下所示:drwxr-----7......