标签:
试题描述
|
输入
|
输出
|
输入示例
|
11 6 5 45 35
|
输出示例
|
Zergling Win!
|
其他说明
|
C++程序:
#include <iostream> using namespace std; int main() { int n; int k; int m; int l; int x; cin >> n >> k >> l >> m >> x; int marine = x; int zerg1 = m; int zerg2 = m; int distance = n; while(marine > 0 && (zerg1 > 0 || zerg2 > 0)) { if(distance && zerg1 > 0) { distance--; zerg1 -= l; } else if(distance && zerg1 <= 0 && zerg2 > 0) { distance--; zerg2 -= l; }else if(zerg1 > 0) { zerg1 -= l; marine -= k * 2; } else { zerg2 -= l; marine -= k; } } if(marine > 0) cout << "Marine Win!" << endl; else cout << "Zergling Win!" << endl; return 0; }
标签:
原文地址:http://www.cnblogs.com/WHYFRANK/p/4719946.html