91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 8.45MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-10-23
  • 語言: C/C++
  • 標簽:

資源簡介

1、IP地址查詢 輸入文件是IPAddr.txt,該文件描述了不同地區(qū)、不同用戶獲得的公有IP地址塊信息。要求將該文件中的數(shù)據(jù)到線性表中,并完成以下的功能。 1)使用靜態(tài)鏈表作為存儲結(jié)構(gòu) 2)靜態(tài)鏈表使用動態(tài)數(shù)組,數(shù)組容量N根據(jù)數(shù)據(jù)集大小確定,N自定義,應是2n 3)實現(xiàn)線性表的4個基本操作 4)附加功能: 4.1)輸入一個點分十進制的IPv4地址,能夠查詢其所屬機構(gòu)。 4.2)輸入一個機構(gòu)名稱,若存在,輸出其擁有IP地址的范圍,若不存在,輸出相應的信息。 4.3)篩選出所有者名稱中以“大學”或“學院”結(jié)尾的機構(gòu),按擁有IP地址數(shù)從大到小排列輸出。

資源截圖

代碼片段和文件信息

/*
2018-6-28
1、IP地址查詢
輸入文件是IPAddr.txt,該文件描述了不同地區(qū)、不同用戶獲得的公有IP地址塊信息。要求將該文件中的數(shù)據(jù)到線性表中,并完成以下的功能。
1)使用靜態(tài)鏈表作為存儲結(jié)構(gòu)
2)靜態(tài)鏈表使用動態(tài)數(shù)組,數(shù)組容量N根據(jù)數(shù)據(jù)集大小確定,N自定義,應是2n
3)實現(xiàn)線性表的4個基本操作
4)附加功能:
4.1)輸入一個點分十進制的IPv4地址,能夠查詢其所屬機構(gòu)。
4.2)輸入一個機構(gòu)名稱,若存在,輸出其擁有IP地址的范圍,若不存在,輸出相應的信息。
4.3)篩選出所有者名稱中以“大學”或“學院”結(jié)尾的機構(gòu),按擁有IP地址數(shù)從大到小排列輸出。

*/
#include
#include
#include
#include
#include?
#include
#include?
using?namespace?std;

const?int?MaxSize?=?100;

typedef?struct?data
{
string?start;
string?last;
string?address1;
string?address2;
}Data;

template?
class?StaticList
{
public:

typedef?struct
{
Data?data;
int?next;

}Node;
StaticList();??????????????????????//
StaticList(DataType?a[]?int?n);????//
~StaticList()?{}????????????????????//
int?Length()?{?return?length;?}????//
void?Get(int?i);????????????//
int?Locate(string?x);?????????//
string?Locate2(string?x);
void?Insert(int?i?DataType?a1?DataType?a2?DataType?a3?DataType?a4);??//
void?Delete(int?i);?????????//
void?PrintList();???????????????//
private:
vector?SList;?????????//
int?length;????????????????????//
int?avail;
};

/*long?Stol(string?str)
{
long?result;
istringstream?is(str);
is?>>?result;
return?result;
}*/

vector?split(const?string?&s?const?string?&seperator)?{
vector?result;
typedef?string::size_type?string_size;
string_size?i?=?0;

while?(i?!=?s.size())?{
//找到字符串中首個不等于分隔符的字母;
int?flag?=?0;
while?(i?!=?s.size()?&&?flag?==?0)?{
flag?=?1;
for?(string_size?x?=?0;?x? if?(s[i]?==?seperator[x])?{
++i;
flag?=?0;
break;
}
}

//找到又一個分隔符,將兩個分隔符之間的字符串取出;
flag?=?0;
string_size?j?=?i;
while?(j?!=?s.size()?&&?flag?==?0)?{
for?(string_size?x?=?0;?x? if?(s[j]?==?seperator[x])?{
flag?=?1;
break;
}
if?(flag?==?0)
++j;
}
if?(i?!=?j)?{
result.push_back(s.substr(i?j?-?i));
i?=?j;
}

}
return?result;
}


template
StaticList::StaticList()
{

length?=?0;
/*for?(int?i?=?1;?i {
SList[i].next?=?i?+?1;
}

SList[SList.max_size?-?1].next?=?-1;*/
avail?=?1;
//SList[0].next?=avail;
ifstream?fin(“IPAddr2.txt“);
string?temp;
int?i?=?0;
cout?<
while?(getline(fin?temp))//導入數(shù)據(jù)
{

vector?s?=?split(temp?““);
//long?a1?=?Stol(s[0]);
//long?a2?=?Stol(s[1]);
Node?TempNode;
TempNode.data.start?=?s[0];
TempNode.data.last?=?s[1];
TempNode.data.address1?=?s[2];
if?(s.size()?==?4)
{
TempNode.data.address2?=?s[3];
}
else
{
TempNode.data.address2?=?“?“;
}
TempNode.next?=?i?+?1;
SList.push_back(TempNode);
//cout?< i++;
}
length?=?i?-?1;
avail?=?i;
cout?<

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-07-02?15:25??IP1.2\
?????目錄???????????0??2018-07-02?15:21??IP1.2\.vs\
?????目錄???????????0??2018-07-02?15:21??IP1.2\.vs\IP1.2\
?????目錄???????????0??2018-07-05?21:57??IP1.2\.vs\IP1.2\v15\
?????文件???????30720??2018-07-05?21:57??IP1.2\.vs\IP1.2\v15\.suo
?????文件?????5623808??2018-07-05?21:57??IP1.2\.vs\IP1.2\v15\Browse.VC.db
?????目錄???????????0??2018-07-02?15:22??IP1.2\.vs\IP1.2\v15\ipch\
?????目錄???????????0??2018-07-02?15:22??IP1.2\.vs\IP1.2\v15\ipch\AutoPCH\
?????目錄???????????0??2018-07-02?15:22??IP1.2\.vs\IP1.2\v15\ipch\AutoPCH\c13797db76a30530\
?????文件????33947648??2018-07-05?21:55??IP1.2\.vs\IP1.2\v15\ipch\AutoPCH\c13797db76a30530\IP1.2.ipch
?????目錄???????????0??2018-07-05?21:56??IP1.2\Debug\
?????文件??????181760??2018-07-05?21:56??IP1.2\Debug\IP1.2.exe
?????文件??????833912??2018-07-05?21:56??IP1.2\Debug\IP1.2.ilk
?????文件??????839680??2018-07-05?21:56??IP1.2\Debug\IP1.2.pdb
?????目錄???????????0??2018-07-05?21:56??IP1.2\IP1.2\
?????目錄???????????0??2018-07-05?21:56??IP1.2\IP1.2\Debug\
?????文件?????????776??2018-07-05?21:55??IP1.2\IP1.2\Debug\IP1.2.Build.CppClean.log
?????文件?????????372??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.log
?????文件??????700362??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.obj
?????目錄???????????0??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.tlog\
?????文件?????????630??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.tlog\CL.command.1.tlog
?????文件???????19774??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.tlog\CL.read.1.tlog
?????文件?????????448??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.tlog\CL.write.1.tlog
?????文件?????????209??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.tlog\IP1.2.lastbuildstate
?????文件????????1098??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.tlog\link.command.1.tlog
?????文件????????4080??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.tlog\link.read.1.tlog
?????文件?????????424??2018-07-05?21:56??IP1.2\IP1.2\Debug\IP1.2.tlog\link.write.1.tlog
?????文件??????150528??2018-07-05?21:56??IP1.2\IP1.2\Debug\vc141.idb
?????文件??????487424??2018-07-05?21:56??IP1.2\IP1.2\Debug\vc141.pdb
?????文件????????9564??2018-07-05?21:56??IP1.2\IP1.2\IP1.2.cpp
?????文件????????5943??2018-07-02?15:22??IP1.2\IP1.2\IP1.2.vcxproj
............此處省略4個文件信息

評論

共有 條評論

相關資源