freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

網(wǎng)絡(luò)課程設(shè)計(jì)報(bào)告ip地址的合法性及子網(wǎng)判斷-資料下載頁(yè)

2025-07-21 12:10本頁(yè)面
  

【正文】 } } flag=1。//首先設(shè)置為非法,即全 for(i=j2。iiplen。i++) { if(atoi(dot[i])!=255) { 中國(guó)計(jì)量學(xué)院現(xiàn)代科技學(xué)院課程設(shè)計(jì)報(bào)告 flag=0。 } } if(flag==1) { coutip地址ip的主機(jī)號(hào)全,error!endl。 return false。 } } return true。}//判斷子網(wǎng)號(hào)subnet是否合法bool ipTest::subnetIsValid(char *subnet){ if(!ipIsValid(subnet)) //調(diào)用判斷Ip的函數(shù)ipIsValid()進(jìn)行判斷 { return false。 } return true。}//判斷ip是否為子網(wǎng)成員,并輸出判斷結(jié)果void ipTest::print(){ char subnet_one[15],ip_one[15]。 int nbip[4],nbsubnet[4],i。 strcpy(subnet_one,subnet)。 //把subnet地址復(fù)制給subnet_one strcpy(ip_one,ip)。 //把ipt地址復(fù)制給ip_one //split()函數(shù)把字符型的地址轉(zhuǎn)換為四段int型的地址 split(subnet_one,nbsubnet)。 //用subnet_one而非subnet是為了保護(hù)subnet地址中國(guó)計(jì)量學(xué)院現(xiàn)代科技學(xué)院課程設(shè)計(jì)報(bào)告 不被破壞 split(ip_one,nbip)。 for(i=0。i4。i++) { nbip[i]=toBinary(nbip[i])。//將分離出來(lái)的十進(jìn)制轉(zhuǎn)換為二進(jìn)制 nbsubnet[i]=toBinary(nbsubnet[i])。 } char *cbip=new char[33]。 char *cbsubnet=new char[33]。 cbip=toString(nbip)。//將二進(jìn)制數(shù)組轉(zhuǎn)換為位的二進(jìn)制字符指針 cbsubnet=toString(nbsubnet)。 for(i=0。imask。i++) { if(cbip[i]!=cbsubnet[i]) { coutendlIP地址:ip不屬于subnet這一子網(wǎng)endl。 //system(pause)。 return。 } } coutendlIP地址:ip屬于subnet這一子網(wǎng)endl。 //system(pause)。 }//十進(jìn)制int型數(shù)據(jù)轉(zhuǎn)換為二進(jìn)制int型數(shù)據(jù)int ipTest:: toBinary(int a){//將十進(jìn)制數(shù)轉(zhuǎn)換為二進(jìn)制數(shù) if(a/2==0) return a%2。 return a%2+toBinary(a/2)*10。 //遞歸調(diào)用} 中國(guó)計(jì)量學(xué)院現(xiàn)代科技學(xué)院課程設(shè)計(jì)報(bào)告 //把二進(jìn)制int型數(shù)據(jù)轉(zhuǎn)換為一個(gè)整體的二進(jìn)制字符型數(shù)據(jù)char * ipTest::toString(int *a){//將二進(jìn)制的數(shù)值數(shù)組轉(zhuǎn)換個(gè)字符長(zhǎng)的字符指針 char *temp=new char[33]。 int i。 bool flag=false。 char *eight=new char(),*seven=new char(),*six=new char(),*five=new char(),*four=new char(), *three=new char(),*two=new char(),*one=new char()。 for(i=0。i4。i++) {//char *itoa(int value,char *string,int radix)將整數(shù)value轉(zhuǎn)換成字符串存入string,radix為轉(zhuǎn)換時(shí)所用基數(shù) itoa(a[i]/10000000,eight,10)。 //產(chǎn)生每段二進(jìn)制字符地址的最高位 itoa(a[i]/1000000%10,seven,10)。 itoa(a[i]/100000%10,six,10)。//a[i]/100000%10為每段的高第三位二進(jìn)制整數(shù) itoa(a[i]/10000%10,five,10)。 itoa(a[i]/1000%10,four,10)。 itoa(a[i]/100%10,three,10)。 itoa(a[i]/10%10,two,10)。 itoa(a[i]%10,one,10)。 if(flag==true) { strcat(temp,eight)。 } else { //第一次循環(huán)時(shí),執(zhí)行此步驟;同時(shí)置flag=true保證以后循環(huán)不執(zhí)行此步 strcpy(temp,eight)。 //第一次循環(huán)的第一次傳遞用連接函數(shù) flag=true。 } strcat(temp,seven)。 strcat(temp,six)。 strcat(temp,five)。 strcat(temp,four)。 strcat(temp,three)。 strcat(temp,two)。 strcat(temp,one)。 } return temp。}課程設(shè)計(jì)報(bào)告評(píng)語(yǔ)指導(dǎo)教師意見(jiàn): 成績(jī)?cè)u(píng)定: 指導(dǎo)教師: 年 月 日24
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1