第38226题 单选题
下面的程序是位掩码技术实现权限的组合管理。首先定义四个权限常量,分别对应读、写、修改、删除, 每个权限占用整数的一个独立二进制位。初始化权限掩码 mask 为 0,代表没有任何权限。如果想实现如下的操 作:添加读权限;添加写权限;清除读权限,其他位不变;添加删除权限。则横线处应该填入的是( )。
#include <iostream>
using namespace std;

int main() {
const int READ = 1 << 0;
const int WRITE = 1 << 1;
const int MODIFY = 1 << 2;
const int DELETE_ = 1 << 3;
int mask = 0;
__________________________
return 0;
}
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析