- 糖果游戏
我错了之后照着书打了一遍怎么还是错的
- @ 2026-10-13 6:55:33
#include<bits/stdc++.h>
using namespace std;
int main(){
int x1,x2,x3,x4,x5;
scanf("%d%d%d%d%d%d"&x1,&x2,&x3,&x4,&x5);
x1=x1/3,x2=x2+x1,x5=x5+x1;
x2=x2/3,x1=x1+x2,x3=x3+x2;
x3=x3/3,x2=x2+x3,x4=x4+x3;
x4/=3,x3=x3+x4,x5=x5+x4;
x5/=3,x4=x4+x5,x1=x1+x5;
printf("%5d%5d%5d%5d%5d",x1,x2,x3,x4,x5);
return 0;
}
教科书P31-32
1 条评论
-
张皓南 LV 9 @ 2026-10-23 18:04:36已修改scanf("%d%d%d%d%d%d"&x1,&x2,&x3,&x4,&x5);
这一段少了一个逗号,应改成scanf("%d%d%d%d%d%d",&x1,&x2,&x3,&x4,&x5);
- 1
信息
- ID
- 1152
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 4
- 标签
- (无)
- 递交数
- 120
- 已通过
- 58
- 上传者