导航:首页 > 源码编译 > C编译指定编码

C编译指定编码

发布时间:2023-09-15 02:59:43

‘壹’ C语言的编程问题,不知道如何编码,希望写一遍代码。谢谢

#include<stdio.h>
#include<stdlib.h>
#include<time.h>
voidmain()
{inthp_a=100,hp_b=100,i=0;
intflag=0;
intattact;
srand((unsigned)time(NULL));
while(hp_a>0&&hp_b>0)
{
i++;
/*printf(" Round:%d ",i);*/
if(flag==0)
{
attact=rand()%(12-8+1)+8;
hp_b-=attact;
printf("AttactA=%d,HP_A=%d,HP_B=%d ",attact,hp_a,hp_b>0?hp_b:0);
flag=1;
}
else
{
attact=rand()%(16-6+1)+6;
hp_a-=attact;
printf("AttactB=%d,HP_A=%d,HP_B=%d ",attact,hp_a>0?hp_a:0,hp_b);
flag=0;
}
}
if(hp_a<=0)printf("****Aisdied**** ");
if(hp_b<=0)printf("****Bisdied**** ");
}

阅读全文

与C编译指定编码相关的资料

热点内容
数字英雄对程序员的影响 浏览:758
程序员培训学校排名 浏览:583
oppo手机如何解开微信的加密 浏览:33
学校论文答辩源码 浏览:63
rp在单片机中 浏览:175
linux软件运行命令 浏览:353
stcid加密程序 浏览:136
把解压包子放到水里 浏览:283
phpmongodb连接池 浏览:943
日本解压捏泡泡纸 浏览:118
环保参比算法 浏览:411
解压中的删掉是什么意思 浏览:764
王牌竞速什么时候能停止维修服务器 浏览:486
pdf阅读器官方 浏览:85
程序员那么爱心 浏览:304
字符a经过md5加密 浏览:417
绿色的小蝴蝶是个什么app 浏览:15
python编程输入数字输出年月日英文 浏览:628
程序员枪手 浏览:748
gm28服务器怎么设置 浏览:544