第六周專案3 IP位址類

2021-07-11 00:21:48 字數 606 閱讀 3467

問題及**:

/*

*檔名稱:test.cpp

*完成日期:2023年4月6日

*輸入:

*程式輸出:

*/#include using namespace std;

class ip

; unsigned int address;

};public:

ip(int,int,int,int);

void showip();

bool samesubnet(const ip &ip, const ip &mark);

char whatkind();

};ip::ip(int s0,int s1,int s2,int s3)

void ip::showip()

{ cout<

執行結果:

知識點總結:

ip位址類有關內容。

學習心得:

ip位址模擬較難,應該多加練習。

第六周專案3 IP位址類

問題及 檔名稱 main.cpp 作 者 趙志君 完成日期 2016年4月5日 版 本 號 v1.0 include include includeusing namespace std class ip 4位元組的ip位址可以看作4部分,每部分1位元組 unsigned int address 4...

第六周專案3 IP位址類

問題及 檔名稱 test.cpp 完成日期 2016年4月13日 版本號 v1.0 輸入描述 無。include using namespace std class ip public ip int 0,int 0,int 0,int 0 void showip bool samesubnet co...

第六周專案3 IP位址類

2015.煙台大學計算機與控制工程學院 all rightreserved.檔名稱 test.cpp 完成日期 2016年4月21日。問題及 在網際網路中使用的ip位址佔4位元組,可以用四段法表示,每段值的範圍為0 255,中間用 隔開,例如202.194.116.97。其實,也可以看看乙個有4位元...