日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 人文社科 > 生活经验 >内容正文

生活经验

ccf 炉石传说

發布時間:2023/11/27 生活经验 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ccf 炉石传说 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

考試的時候寫了現在兩倍長的代碼卻只得了60分。〒▽〒〒▽〒〒▽〒。這題沒有什么東西細心一點就行了。

#include<bits/stdc++.h>
using namespace std;
typedef struct
{int t,h;
}S;
S s[2][10];
int main()
{s[0][0].h=30;s[1][0].h=30;int n,a,b,d;int cnt;char c[20];scanf("%d",&n);S temp;int flag=0;while(n--){scanf("%s",c);if(strcmp(c,"summon")==0){scanf("%d %d %d",&a,&b,&d);temp.t=b,temp.h=d;for(int i=6;i>=a;i--){s[flag%2][i+1]=s[flag%2][i];}s[flag%2][a]=temp;}if(strcmp(c,"attack")==0){scanf("%d %d",&a,&b);S t1=s[flag%2][a];S t2=s[(flag+1)%2][b];s[flag%2][a].h-=t2.t;if(s[flag%2][a].h<=0){for(int i=a;i<=6;i++)s[flag%2][i]=s[flag%2][i+1];}s[(flag+1)%2][b].h-=t1.t;if(s[(flag+1)%2][b].h<=0&&b!=0){for(int i=b;i<=6;i++)s[(flag+1)%2][i]=s[(flag+1)%2][i+1];}	}if(strcmp(c,"end")==0)flag++;}cnt=0;if(s[0][0].h<=0)printf("-1\n");else if(s[1][0].h<=0)printf("1\n");else printf("0\n");printf("%d\n",s[0][0].h);for(int i=1;i<=7;i++){if(s[0][i].h>0)cnt++;}printf("%d ",cnt);for(int i=1;i<=cnt;i++)printf("%d ",s[0][i].h);printf("\n");cnt=0;printf("%d\n",s[1][0].h);for(int i=1;i<=7;i++)if(s[1][i].h>0)cnt++;printf("%d ",cnt);for(int i=1;i<=cnt;i++)printf("%d ",s[1][i].h);
}


總結

以上是生活随笔為你收集整理的ccf 炉石传说的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。