#include <iostream>
using namespace std;
void bi(int a);
int main()
{
// here is the issue how do start a loop, where i want the answer from 16 to 31 numbers
int a=0;
cout<<"Baum-Sweet Sequence From 16 to 31 \n";
for(int j=a;j>16 && j<31;j++)
{
cout<<j;
}
bi(a);
system("Pause");
}
// Rest is working properly
void bi(int a)
{
int myArr[15],i=0,f=0,n=0;
for (int h = 0 ; h <= a; h++)
{
int num = h;
for (i = 0 ; i < 4 ; i++)
{
myArr[i] = num%2;
num = num/2;
}
for (int t = 0 ; t < 4 ; t++)
{
if (myArr[t]%2==0)
f++;
}
if (f%2==0)
cout << " = " << 1;
else
cout << " = " << 0;
cout <<endl;
}
}
i zeigen wollen, um die Sequenz 16-31 Dezimalzahl helfen konnte, aber es ist nicht zeigt: \ konnte jedermann helfen Sie mir hierich will die Sequenz ftom 16 bis 31 Dezimalzahl zeigen, aber es ist nicht zeigt: mir jemand hier aus
Was soll Ihr Code tun? Und was glauben Sie, wäre das Ergebnis von 'int j = a; j> 16 & & j<31; j ++ 'wäre, wenn' j == 0 ', wie es wäre, wenn Sie ihm' a' zuweisen? –