#includeusing namespace std;//-----------------------class Hailstone{int n;public:Hailstone(int number){n=number;};void print(){while(n!=1){if (n%2==0){n=n/2;}else {n=n*3+1;}cout
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/20 21:45:35
x)SK)MI--KWKM-.HLNU(.Is<3sKR3JJr2`ܤ"<[˺ֺ,?3E(Y]hkYjdkk Vod]S hkZ&痖$Ý
`s;X BfBfX3$ŷ`q4/C
~͐g>ٱɎg3?lF߳jAs }/.za]m@
O'LٚOsh}tDj_.{`ϋ3Xlg-Ov'z g
#includeusing namespace std;//-----------------------class Hailstone{int n;public:Hailstone(int number){n=number;};void print(){while(n!=1){if (n%2==0){n=n/2;}else {n=n*3+1;}cout
#include
using namespace std;
//-----------------------
class Hailstone{
int n;
public:
Hailstone(int number){n=number;};
void print()
{
while(n!=1)
{
if (n%2==0){n=n/2;}
else {n=n*3+1;}
cout
#includeusing namespace std;//-----------------------class Hailstone{int n;public:Hailstone(int number){n=number;};void print(){while(n!=1){if (n%2==0){n=n/2;}else {n=n*3+1;}cout
这个不是很明显的class Hailstone 后面少了个}吗
下次好好看清楚
代码风格还是要注意啊