#include stdioh
#include conioh
struct stu{
char name[20]
char sex
int no
int age
struct stu * next
}*linklist
struct stu *creatlist(int n)
{
int i
h头结点p前结点s前结点
struct stu *h*p*s
h (struct stu *)malloc(sizeof(struct stu))
h>next NULL
ph
for(i0i
{
s (struct stu *)malloc(sizeof(struct stu))
p>next s
printf(Please input the information of the student name sex no age \n)
scanf(s c d ds>name&s>sex&s>no&s>age)
s>next NULL
p s
}
printf(Create successful)
return(h)
}
void deletelist(struct stu *sint a)
{
struct stu *p
while(s>agea)
{
p s
s s>next
}
if(sNULL)
printf(The record is not exist)
else
{
p>next s>next
printf(Delete successful)
}
}
void display(struct stu *s)
{
s s>next
while(sNULL)
{
printf(s c d d\ns>names>sexs>nos>age)
s s>next
}
}
int main()
{
struct stu *s
int nage
printf(Please input the length of seqlist\n)
scanf(d&n)
s creatlist(n)
display(s)
printf(Please input the age\n)
scanf(d&age)
deletelist(sage)
display(s)
return 0
}
2实现函数字符串中字符写转写
#include stdioh
#include conioh
void uppers(char *schar *us)
{
for(*s'\0's++us++)
{
if(*s>'a'&&*s<'z')
*us *s32
else
*us *s
}
*us '\0'
}
int main()
{
char *s*us
char ss[20]
printf(Please input a string\n)
scanf(sss)
s ss
uppers(sus)
printf(The result is\ns\nus)
getch()
}
机输入数判断称数(回文数)(31211232145254)字符串库函数
***************************************************************
1
函数名称:Symmetry
功: 判断数时候回文数(12135653)
输入: 长整型数
输出: 回文数返回值1 esle 0
******************************************************************
unsigned char Symmetry (long n)
{
long itemp
in temp0
while(i) 出现长度问题数高低位掉换
{
temptemp*10+i10
i10
}
return(tempn)
}
方法
*
功:
判断字符串否回文数字
实现:
先字符串转换正整数正整数逆序组合新正整数两数相回文数字
输入:
char *s:判断字符串
输出:
返回:
0:正确1:判断字符串空2:判断字符串数字
3:字符串回文数字4:判断字符串溢出
*
unsigned IsSymmetry(char *s)
{
char *p s
long nNumber 0
long n 0
long nTemp 0
*判断输入否空*
if (*s \'\\0\')
return 1
*字符串转换正整数*
while (*p \'\\0\')
{
*判断字符否数字*
if (*p<\'0\' || *p>\'9\')
return 2
*判断正整数否溢出*
if ((*p\'0\') > (4294967295(nNumber*10)))
return 4
nNumber (*p\'0\') + (nNumber * 10)
p++
}
*数字逆序组合直接抄楼高手代码莫怪呵呵*
n nNumber
while(n)
{
*判断正整数否溢出*
if ((n10) > (4294967295(nTemp*10)))
return 3
nTemp nTemp*10 + n10
n 10
}
*较逆序数原序数否相等*
if (nNumber nTemp)
return 3
return 0
}
方法二
*
功:
判断字符串否回文数字
实现:
先字符串长度次较字符串应位字符否相
输入:
char *s:判断字符串
输出:
返回:
0:正确1:判断字符串空2:判断字符串数字
3:字符串回文数字
*
unsigned IsSymmetry_2(char *s)
{
char *p s
int nLen 0
int i 0
*判断输入否空*
if (*s \'\\0\')
return 1
*字符串长度*
while (*p \'\\0\')
{
*判断字符否数字*
if (*p<\'0\' || *p>\'9\')
return 2
nLen++
p++
}
*长度奇数回文数字*
if (nLen2 0)
return 4
*长度1回文数字*
if (nLen 1)
return 0
*次较应字符否相*
p s
i nLen2 1
while (i)
{
if (*(p+i) *(p+nLeni1))
return 3
i
}
return 0
}
求2~2000素数足够存求量快
答案:
int findvalue[2000]{2}
static int find1
bool adjust(int value)
{
assert(value>2)
if(value2) return true
for(int i0i
if(valuefindvalue[i]0)
return false
}
findvalue[find++]
return true
}
写程序 求功:求出125三数数组合100组合数
:1001组合51加195组合 请C++语言写
答案:容易想算法:
设x1数y2数z5数number组合数
注意0
number0
for (x0 x<100 x++)
for (y0 y<50 y++)
for (z0 z<20 z++)
if ((x+2*y+5*z)100)
number++
cout<
面程序循环100*50*20次效率实太低
事实题目道明显数学问题单纯编程问题解法:
x+2y+5z100
x+2y1005zz<20 x<100 y<50
(x+2y)<100(x+5z)偶数
z作循环求x值:
z0 x100 98 96 0
z1 x95 93 1
z2 x90 88 0
z3 x85 83 1
z4 x80 78 0
z19 x5 3 1
z20 x0
组合总数100偶数+95奇数+90偶数++5奇数+1
:
(51+48)+(46+43)+(41+38)+(36+33)+(31+28)+(26+23)+(21+18)+(16+13)+(11+8)+(6+3)+1
某偶数m偶数数(包括0)表示m2+1(m+2)2
某奇数m奇数数表示(m+2)2
求总组合次数编程:
number0
for (int m0m<100m+5)
{
number+(m+2)2
}
cout<
倍作简单数学分析
次证明:计算机程序数结构+算法算法程序灵魂工程问
题软件实现时必须选取满足前资源限制户需求限制开发时间限制等种
种限制条件优算法绝手立刻容易想算法编出程序
事——专业研发员行
种容易想算法完全没?种算法正验证新算法
正确性调试阶段非常公司例微软采种方法:调
试阶段重需算法实现程序种算法较复杂时时
容易想算法验证段程序果两种算法出结果致(容易想算法保
证正确)说明优化算法出问题需修改
举例表示:
#ifdef DEBUG
int simple()
#end if
int optimize()
in a function
{
resultoptimize()
ASSERT(resultsimple())
}
样调试阶段果简单算法优化算法结果致会出断言时程
序发布版会包含笨重simple()函数——型工程软件需预先设计良
调试手段里提种方法
1ABCD四进程Abuf里面写数BCDbuf里面读数
A写完BCD读次A写PV操作实现
2单链表reverseABCD变成DCBA搜索链表次
3二叉树两孩子换位置左变右右变左递规(变态)
1static什途?(请少说明两种)
1)函数体声明静态变量函数调程中维持值变
2) 模块(函数体外)声明静态变量模块函数访问模块外函数访问全局变量
3) 模块声明静态函数模块函数调函数限制声明模块范围
2引指针什区?
1) 引必须初始化指针必
2) 引初始化改变指针改变指象
3) 存指空值引存指空值指针
3描述实时系统基特性
特定时间完成特定务实时性性
4全局变量局部变量存中否区?果什区?
全局变量储存静态数库局部变量堆栈
5什衡二叉树?
左右子树衡二叉树 左右子树深度差值绝值1
6堆栈溢出般什原导致?
没回收垃圾资源
7什函数声明虚函数?
constructor函数声明虚函数
8泡排序算法时间复杂度什?
时间复杂度O(n^2)
9写出float x 零值较if语句
if(x>0000001&&x<0000001)
10Internet采种网络协议?该协议层次结构?
TcpIp协议
层次结构: 应层传输层网络层数链路层物理层
11Internet物理址IP址转换采什协议?
ARP (Address Resolution Protocol)(址解析協議)
12IP址编码分俩部分?
IP址两部分组成网络号机号子网掩码位区分网络位机位
13户输入MN值1N开始序循环数数数M输出该数值直全部输出写出C程序
循环链表取余操作做
14做switch()参数类型:
switch参数实型
家说:(感觉华然分高题做实侮辱智商)
1意:38头牛中选出3头跑快次供6头赛场求快方法(傻瓜答案发现起笔试恰38知道**什意思?)
2意:公司职员知道老板年龄知道女年龄老板3女年龄相加13相老板年龄女年龄5岁求4年龄?(网堆答案)
3原题2002年前道学生数学建模竞赛题说学生雨宿舍食堂吃饭200米距离问走着少淋雨跑着少?(该题简化部分假设剩点点问题解决做着没劲)
1属物理层设备( )
A中继器
B太网交换机
C桥
D网关
2太网中根( )址区分设备 ALLC址
BMAC址
CIP址
DIPX址
3传输层协议()
AIP
BICMP
CUDP
DSPX
4MAC址描述正确()
A32位2进制数组成
B48位2进制数组成
C前6位16进制IEEE负责分配
D6位16进制IEEE负责分配
5属数链路层功()
A定义数传输速率
B定义物理址
C描述网络拓扑结构
D流控制
6IEEE8023u标准指( )
A太网
B快速太网
C令牌环网
DFDDI网
7果两计算机通双绞线直接连接正确线序()
A1122334455667788
B1221364455637788
C1326314455627788
D两计算机通双绞线直接连接
8V35V24规程中控制信号RTS表示()
A数终端准备
B数准备
C数载体检测
D请求发送
E清发送
9路器作网络互连设备必须具备特点( )
A少支持两网络接口
B协议少实现网络层
C少支持两种子网协议
D少具备备份口
E具存储转发寻径功
F组路协议
G必须较高协议处理力
10路器作()
A异种网络互连
B子网间速率适配
C连接局域网两台计算机
D隔离网络防止网络风暴指定访问规(防火墙)
E子网协议转换
F加快网络报文传递速度
G路(寻径):路表建立刷新查找
H报文分片重组
11调条历史命令快捷键()
ACTRLP
BCTRLO
CALTP
DALTO
12交换机工作OSI七层层?()
A层
B二层
C三层
D三层
13CSMACD描述正确( )
A数发送前网络否空闲进行检测
B数发送时网络否空闲进行检测
C数发送时发送数进行突检测
D发生碰撞MAC址机拥发送优先权
14STORE AND FORWARD描述正确( )
A收数进行处理立发送
B收数帧头检测目标MAC址立发送
C收整数进行CRC校验确认数正确性发送
D发送延时较
E发送延时较
15交换机工作方式描述正确( )
A半双工方式工作
B全双工方式工作
C全双工方式工作时进行回路突检测
D半双工方式工作时进行回路突检测
16VLAN作()
A保证网络安全
B抑制广播风暴
C简化网络理
D提高网络设计灵活性
17交换机中户权限分级( )
A1
B2
C3
D4
18路器配置程中查询S开头命令方法()
A直接?
BS
CS
DDIR S*
19第次配置路器时方法( )
ACON口配置
BCON口远程配置
CAUX口远程配置
DTELNET远程配置
20种状态路器改名()
A普通模式
B超级模式
C全局模式
D接口模式
21某公司申请C类IP址连接6子公司子公司 26台计算机子公司网段中子网掩码应设()
A2552552550
B255255255128
C255255255192
D255255255224
22101101229 mask 255255255224属网段机IP址()
A10110120
B101101230
C101101231
D101101232
23ARP协议作( )
A端口号映射IP址
B连接IP层TCP层
C广播IP址
DIP址映射第二层址
24路器接收IP报文TTL值等1时采取策略( )
A丢掉该分组
B该分组分片
C转发该分组
D答案均
25NetWare 网络中客户需访问某类型服务器时首先发送 ()广播报文寻找服务器
ARip
BSap
CGns
DArp
26IPX址网络址( )字节
A10
B8
C4
D6
27帧中继描述正确( )
A具意义DLCI描述PVC
B具全局意义DLCI描述PVC
C具意义DLCI描述SVC
D具全局意义DLCI描述SVC
28INVERSE ARP描述正确( )
A通广播方式解析端网络址
B通播方式解析端网络址
C通LMI信令解析端网络址
D通广播方式解析端DLCI
29列PAP协议描述正确( )
A两步握手方式完成验证
B三步握手方式完成验证
C明文密码进行验证
D加密密码进行验证
30X25帧中继描述正确( )
AX25面连接协议传输正确性稳定性高帧中继
BX25具两层结构较帧中继简单
CX25IP言传输效率低帧中继
DX25提供帧中继更服务
31X25映射作( )
A映射IP端端口值便路器发送数时确认发送端口
B映射IP端口值便路器发送数时确认发送端口
C映射端IP端口值便X25交换网络查找数发送路径
D映射端IP端端口值便X25交换网络查找数发送路径
32路协议衡量路坏标准( )
A路
B路器优先级
C路权
D包转发率
33基链路状态算法动态路协议()
ARIP
BICMP
CIGRP
DOSPF
34三种路协议 RIP OSPF IGRP 条达目标网络华路器默认情况网络终选选定() 路作优路
ARIP
BOSPF
CIGRP
D静态路
35路环问题会引起()
A循环路器
B慢收敛
C路器重起
D路致
36OSPF 协议适基 IP ( )
A型网络
B中型网络
C更规模网络
Dispisp间
37rip中metric等()达
A8
B9
C10
D15
E16
38ISDN BRI描述正确()
A2B+D
B30B+D
C轴电缆作物理传输介质
D普通电话线作物理传输介质
39设置话机模拟入呼时需检查号码子址命令( )
Aisdn pots1answer
Bisdn pots2answer
Cisdn answer1
Disdn answer2
40DDR命令( )
AAccesslist
Bdialer inband
CDialergroup
DDialerlist
41访问控制列表配置中*作符 gt portnumber表示控制( )
A端口号数字服务
B端口号数字服务
C端口号等数字服务
D端口号等数字服务
42某台路器配置条访问列表
accesslist 4 deny 2023800 00255255
accesslist 4 permit 202381601 000255
表示:( )
A禁止源址2023800网段访问
B允许目址2023800网段访问
C检查源IP址禁止2023800网段机允许中202381600网段机
D检查目IP址禁止2023800网段机允许中202381600网段机
43某单位路器防火墙作配置:
firewall enable
accesslist normal 101 permit ip 2023800 000255 10101010 000255
accesslist normal 101 deny tcp 2023800 000255 10101010 000255 gt 1024
accesslist normal 101 deny ip any any
端口配置
interface Serial0
Enable
Ip address 2023811125 2552552550
encapsulation ppp
ip accessgroup 101 out
interface Ethernet0
ip address 1010101 2552552550
部局域网机均1010100 2552552550网段说法正确(题假设网络均没防火墙):()
A外部机20238050ping通部机
B部机1010105意访问外部网络资源
C外部2023850 2552552550网段机部网机建立tcp连接
D外部2023800 2552552550网段机部网机建立tcp连接
E部意机外部意机建立tcp连接
F部意机外部2023800 2552552550网段机建立tcp连接
44RIP 协议适基 IP ()
A型网络
B中型网络
C更规模网络
Dispisp间
45协议中面连接协议( )
AX25
BEthernet
CIP
DFramerelay
46路器A配置:
Quidway#SHOW RUN
Current configuration
user huawei servicetype ppp password 0 quidway
interface Ethernet0
ip address 1111 255000
interface Serial0
encapsulation ppp
ppp authentication chap
ppp chap host huawei
ip address 2111 255000
interface Serial1
encapsulation ppp
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
exit
ip route 0000 0000 2112 preference 60
end
路器B配置
Quidway#SHOW RUN
Current configuration
user hw servicetype ppp password 0 quidway
ip address 3111 255000
interface Serial0
clockselect DTECLK1
encapsulation ppp
ppp chap host huawei
ip address 1112 255000
interface Serial1
encapsulation ppp
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
exit
ip route 0000 0000 2112 preference 60
end
发现两端路器PING端太网端口述说法正确()
AA验证配置错误
BB验证配置错误
CA验证方路配置错误
DB验证方路配置错误
47路器A配置:
Quidway#SHOW RUN
Now create configuration
Current configuration
interface Ethernet0
ip address 1111 255000
clockselect DTECLK1
encapsulation x25 dte ietf
x25 address 2111
x25 map ip 2112 2112
ip address 2111 255000
interface Serial1
encapsulation ppp
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
exit
router rip
end
路器B配置
Quidway#SHOW RUN
Now create configuration
Current configuration
interface Ethernet0
ip address 3111 255000
interface Serial0
encapsulation x25 dce ietf
x25 address 2112
x25 map ip 2111 2111
ip address 2112 255000
interface Serial1
encapsulation ppp
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
exit
router rip
end
说法正确()
A两端广域网联通局域网连通
B两端广域网连通局域网连通
C广域网局域网连通
D广域网局域网连通
48路器A配置:
Quidway#SHOW RUN
Now create configuration
Current configuration
framerelay switching
interface Ethernet0
ip address 10111 25525500
ip rip version 2 mcast
interface Serial0
clockselect DTECLK1
encapsulation framerelay
framerelay intftype DCE
framerelay interfacedlci 100
ip address 2111 255000
ip rip version 2 mcast
interface Serial1
encapsulation ppp
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
exit
router rip
no autosummary
neighbor 2112
end
路器B配置
Quidway#SHOW RUN
Now create configuration
Current configuration
interface Ethernet0
ip address 10211 25525500
ip rip version 2 mcast
interface Serial0
encapsulation framerelay
ip address 2112 255000
ip rip version 2 mcast
interface Serial1
encapsulation ppp
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
exit
router rip
no autosummary
neighbor 2111
End
说法正确( )
A两端广域网联通局域网连通
B两端广域网连通局域网连通
C广域网局域网连通
D广域网局域网连通
49路器A配置:
Quidway#SHOW RUN
Now create configuration
Current configuration
interface Ethernet0
ip address 10111 25525500
ip ospf enable area 0001
interface Serial0
clockselect DTECLK1
encapsulation ppp
ip address 2111 255000
ip ospf enable area 0001
interface Serial1
encapsulation ppp
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
exit
router ospf enable
end
路器B配置
Quidway#SHOW RUN
Now create configuration
Current configuration
interface Ethernet0
ip address 10211 25525500
ip ospf enable area 0002
interface Serial0
encapsulation ppp
ip address 2112 255000
ip ospf enable area 0002
interface Serial1
encapsulation ppp
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
exit
router ospf enable
End
说法正确( )
A两端广域网联通局域网连通
B两端广域网连通局域网连通
C广域网局域网连通
D广域网局域网连通
50路器A配置
Quidway#SHOW RUN
Now create configuration
Current configuration
interface Ethernet0
ip address 10211 25525500
interface Serial0
encapsulation ppp
backup interface Serial 1
ip address 2111 255000
interface Serial1
encapsulation ppp
ip address 3111 255000
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
Exit
Router rip
End
路器B配置
Quidway#SHOW RUN
Now create configuration
Current configuration
interface Ethernet0
ip address 10111 25525500
interface Serial0
encapsulation ppp
backup interface Serial 1
ip address 2111 255000
interface Serial1
encapsulation ppp
ip address 3111 255000
interface Serial2
flowcontrol normal
async mode dedicated
encapsulation ppp
Exit
Router rip
End
述说法正确( )
A备份功正常
B备份功正常
C两端正常互联
D两端正常互联
1~10
A B CD BC CD B C D ABE ABDG
11~20
A B A DCE ABD ACD D B A B
21~30
DBC D C B A A C AC AC
31~40
C C DB ABD C E AD AB B
41~50
B C AC B AD bcd A C A BCD
1static什途?(请少说明两种)
1)函数体声明静态变量函数调程中维持值变
2) 模块(函数体外)声明静态变量模块函数访问模块外函数访问全局变量
3) 模块声明静态函数模块函数调函数限制声明模块范围
2引指针什区?
1) 引必须初始化指针必
2) 引初始化改变指针改变指象
3) 存指空值引存指空值指针
3描述实时系统基特性
特定时间完成特定务实时性性
4全局变量局部变量存中否区?果什区?
全局变量储存静态数库局部变量堆栈
5什衡二叉树?
左右子树衡二叉树 左右子树深度差值绝值1
6堆栈溢出般什原导致?
没回收垃圾资源
7什函数声明虚函数?
constructor函数声明虚函数
8泡排序算法时间复杂度什?
时间复杂度O(n^2)
9写出float x 零值较if语句
if(x>0000001&&x<0000001)
10Internet采种网络协议?该协议层次结构?
TcpIp协议
层次结构: 应层传输层网络层数链路层物理层
11Internet物理址IP址转换采什协议?
ARP (Address Resolution Protocol)(址解析協議)
12IP址编码分俩部分?
IP址两部分组成网络号机号子网掩码位区分网络位机位
13户输入MN值1N开始序循环数数数M输出该数值直全部输出写出C程序
循环链表取余操作做
14做switch()参数类型:
switch参数实型
网球中心100网球场单位申请1100场申请场编号必须连续果场已单位占次单位完场必须请设计完整系统(c语言)(限时5分钟)
Tennish
struct TennisGround
{
int num
char *agentName
}
typedef struct TennisGround TG
void mallocTG(TG *total)
void freeTG(TG *total)
Tennisc
#include
#include
#include
#include
#include Tennish
void mallocTG(TG *total)
{
int size startcount 0
char *agentName (char*)malloc(sizeof(char)*10)
printf(Please input your agentName)
scanf(s agentName)
printf(Please input the size of the TennisGround)
scanf(d &size)
printf(Please input the TennisGround number you want to start)
scanf(d &start)
if((total+start)>agentName )
{
printf(malloc failed\n)
exit(1)
}
else
{
while(count < size)
{
(total+start+count)>agentName agentName
count++
}
}
}
void freeTG(TG* total)
{
char *an (char*)malloc(sizeof(char)*10)
printf(please input agentName you want to free)
scanf(s an)
int count 0
while(count < 100)
{
if(strcmp((total+count)>agentName an) 0)
(total+count)>agentName
count++
}
}
int main()
{
int i
int sw
TG *total (TG*)malloc(sizeof(TG)*100)
for(i0 i<100 i++)
{
(total+i)>num i
(total+i)>agentName
}
while(1)
{
printf(*******Tennis Ground Mallocation******************\n)
for(i0 i<100 i++)
{
printf(d(s) (total+i)>num (total+i)>agentName)
if(i5 0)
printf(\n)
}
printf(\n)
printf(**************************************************\n)
printf(Please input your choosen(1malloc2free))
scanf(d &sw)
if(sw 1)
mallocTG(total)
else
freeTG(total)
}
return 0
文档香网(httpswwwxiangdangnet)户传
《香当网》用户分享的内容,不代表《香当网》观点或立场,请自行判断内容的真实性和可靠性!
该内容是文档的文本内容,更好的格式请下载文档