2826: 雇佣兵 (几种解法,存疑)
摘要:以下有两种思路的代码,第一种:
```c
int main()
{
int zhan,neng,M,N,X;
scanf("%d%d%d",&M,&zhan,&ne……
雇佣兵(while循环)
摘要:解题思路:注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int m,n,x,i,a; scanf("%d %d %d",&m,&n,&x……
感觉这个代码没什么毛病,但是就是有两个测试点过不了,球球帮孩子看看
摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <stdlib.h>#include<string.h>#include<math.h>int main(){ ……
2826: 雇佣兵(python)
摘要:解题思路:注意事项:参考代码:from decimal import *
M,N,X = map(int,input().split())
while X > 0 and X * N >= M:
……
whilewhilewhile,这个代码短,但是效率低一点,while还不熟练哈哈
摘要:解题思路:swap转换注意事项:参考代码:#include<stdio.h> int main() { int m, n, x; scanf("%d %d %d", &m, &n……
挺有趣的哈哈这题目,这个代码有详细解读代码长
摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int m,M,n,x,i; scanf("%d %d %d",&M,&n,&x); //M为最大体力值,n为……
(c语言)详细解读,算法简单易懂
摘要:解题思路: 题目我整理一下,初始体力0,每消耗一点能量,体力增加一次当前战斗力的值。同一个战斗期内,每经过战斗力数值的天数,战斗力加1。注意事项: 在一个战斗期内,战斗力是不会提升的。 ……