D. [GESP]L3-202406-Q2384-S
[GESP]L3-202406-Q2384-S
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
下列代码将十进制转化成八进制,则横线上应填入( )。
#include <iostream>
using namespace std;
void decimal2octal(int decimal) {
int oct_number[100];
int i = 0;
while (decimal > 0) {
________________________ // 在此处填入代码
}
for (int j = i - 1; j >= 0; j--) {
cout << oct_number[j];
}
cout << endl;
}
{{ select(1) }}
oct_number[i] = decimal % 8; decimal /= 8;oct_number[i] = decimal / 8; decimal %= 8;oct_number[i++] = decimal % 8; decimal /= 8;oct_number[i++] = decimal / 8; decimal %= 8;
GESP 2024.06 C++ 三级 全真模拟赛
- 状态
- 已结束
- 规则
- OI
- 题目
- 27
- 开始于
- 2026-11-20 13:30
- 结束于
- 2026-11-25 13:30
- 持续时间
- 2 小时
- 主持人
- 参赛人数
- 0