这是原题的一部分(英文的):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

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/12 04:50:49
这是原题的一部分(英文的):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

这是原题的一部分(英文的):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
这是原题的一部分(英文的):
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
y|x=x,这里的|是按位或运算,是正确的啊,怎么会错误?
#include
int S(int a) {
int n = 0;
for(int i = 0; i