这是原题的一部分(英文的):
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/06/25 20:06:05
这是原题的一部分(英文的):
Supposed two nonnegative integers x ,y.We say y is the subset of x when y is not bigger than x and the result of y OR x is equal to x (that is to say ,y|x = x).
We use S(a) represents the number of subsets of a .For example ,the subsets of 6 are 6 ,4 ,2 ,0,so S(6) = 4.
有这样运算的吗?我用C++输入这样的代码也一样错误,高手教教我,
Supposed two nonnegative integers x ,y.We say y is the subset of x when y is not bigger than x and the result of y OR x is equal to x (that is to say ,y|x = x).
We use S(a) represents the number of subsets of a .For example ,the subsets of 6 are 6 ,4 ,2 ,0,so S(6) = 4.
有这样运算的吗?我用C++输入这样的代码也一样错误,高手教教我,
![这是原题的一部分(英文的):](/uploads/image/z/2380148-44-8.jpg?t=%E8%BF%99%E6%98%AF%E5%8E%9F%E9%A2%98%E7%9A%84%E4%B8%80%E9%83%A8%E5%88%86%EF%BC%88%E8%8B%B1%E6%96%87%E7%9A%84%EF%BC%89%EF%BC%9A)
y|x=x,这里的|是按位或运算,是正确的啊,怎么会错误?
#include
int S(int a) {
int n = 0;
for(int i = 0; i
#include
int S(int a) {
int n = 0;
for(int i = 0; i