这是原题的一部分(英文的):

这是原题的一部分(英文的):
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++输入这样的代码也一样错误,高手教教我,

问答人气:966 ℃时间:2024-05-07 22:13:08
优质解答

y|x=x,这里的|是按位或运算,是正确的啊,怎么会错误?
#include
int S(int a) {
int n = 0;
for(int i = 0; i

我来回答
请使用1024x768 IE6.0或更高版本浏览器浏览本站点,以保证最佳阅读效果。本页提供作业小助手,一起搜作业以及作业好帮手最新版!
版权所有 CopyRight © 2012-2024 作业小助手 All Rights Reserved. 手机版