const size=100; var n,i,sum,x:integer; a:array[1..size] of integer; begin readln(n); fillchar(a,sizeof(a),0); for i:=1 to n do begin read(x); inc(a[x]); end; i:=0; sum:=0; while sum<(n div 2 + 1) do begin inc(i); sum:=sum+a[i]; end; writeln(i); end. 输输: 11 4 5 6 6 4 3 3 2 3 2 1 输输: _________ 输输输输
39
Embed
const size=100; var n,i,sum,x:integer; a:array[1..size] of integer; begin readln(n);
const size=100; var n,i,sum,x:integer; a:array[1..size] of integer; begin readln(n); fillchar(a,sizeof(a),0); for i:=1 to n do begin read(x); inc(a[x]); end; i:=0; sum:=0; while sum
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
const size=100;var n,i,sum,x:integer; a:array[1..size] of integer;begin readln(n); fillchar(a,sizeof(a),0); for i:=1 to n do begin read(x); inc(a[x]); end; i:=0; sum:=0; while sum<(n div 2 + 1) do begin inc(i); sum:=sum+a[i]; end; writeln(i);end.
输入:
11
4 5 6 6 4 3 3 2 3 2 1
输出: _________
第十七届
Ip 的分类与管理
IP 地址的分类
分类缘由
网络规模不同,合理充分的利用 IP 地址
IP 地址由网络标识和主机标识组成。
电话:区号 + 电话号码
0 1 0
0 5 1 1
同是 5 位
需要有不同网段
那么每一类又有什么样的特征呢?
IP 地址类型
第一字节表示的十进制数的范围
可支持的网络数目
每个网络支持的主机数
A 类 0~126 126 1677214
B 类 128~191 16384 65534
C 类 192~223 2097152 254
E 类 224~ 239
D 类 240~ 255
IP 地址十进制数的范围
特殊 ip : 127.x.y.z ,作为环回接口预留,如:发送消息给 127.0.0.1, 此消息将回传给自己
A 类:分配给少数规模很大的网络B 类:分配给中等规模的网络C 类:分配给小规模的网络D 类:用于广播地址E 类:用于保留地址
172.16.0.1—172.31.255.254
10.0.0.1—10.255.255.254
192.168.0.1—192.168.0.254
169.254.*.*
单位信箱 各家的
各家的
各家的
私有地址 :单位内部的每一个部门或个人都有一个惟一的内部信箱号。
因特网地址分配机构( IANA )负责全球 IP 地址与域名的管理。全球 IP 地址的分配是按照一种分级的方式管理的。
计算机是通过 IP 地址识别所要访问的目标。域名与地址之间需要进行转换,这个任务就是由 DNS 服务器来完成的。
域名系统
1 .因特网上一个服务器或一个网络系统的名字,称为( ),网络间正是通过它进行相互访问的。 A .主机名 B .计算机系统名 C . IP 地址 D .域名
2 .下列域名格式中,哪种域名是不正确的。( ) A . aa.0898.net B . [email protected] C . bb.edu.haha.com D . hahahaha.net
3 . QQ 站点( http://www.qq.com )的域名是( ) A . http://www.qq.com/ B . www.qq.com C . qq.com D .以上都不是 4. 域名 maze . pku . edu . cn 中,表示主机名的是 ( ) 。 A . maze B . pku C . edu D . cn5. 下列域名中,表示教育机构的是 ( ) 。 A . ftp . bta . net . en B . ftp . cnc . ac . cn C . www . ioa . ac . cn D . www.buaa . edu . cn