实验三答案
- 格式:doc
- 大小:63.50 KB
- 文档页数:8
1. What is the IP address and TCP port number used by the client computer (source) that is transferring the file to ? To answer this questio n, it’s probably easiest to select an HTTP message and explore the details of the TCP packet used to carry this HTTP message, using the “details of the selected packet header window” (refer to Figure 2 in the “Getting Started with Wireshark” Lab if you’re uncertain about the Wireshark windows).Ans: IP address:192.168.1.102 TCP port:11612. What is the IP address of ? On what port number is it sending and receiving TCP segments for this connection?Ans: IP address:128.119.245.12 TCP port:80If you have been able to create your own trace, answer the following question:3. What is the IP address and TCP port number used by your client computer(source) to transfer the file to ?ANS: IP address :10.211.55.7 TCP port:492654. What is the sequence number of the TCP SYN segment that is used to initiate the TCP connection between the client computer and ? What is it in the segment that identifies the segment as a SYN segment?ANS: sequence number: 0 Syn Set = 1 identifies the segment as a SYN segment5. What is the sequence number of the SYNACK segment sent by to the client computer in reply to the SYN? What is the value of the ACKnowledgement field in the SYNACK segment? How did determine that value? What is it in the segment that identifies the segment as a SYNACK segment?ANS: The sequence number: 0ACKnowledgement number : 1 which is sequence number plus 1Both the sequence flag and the ACKnowledgement flag been set as 1, identifies the segment as SYNACK segment.6. What is the sequence number of the TCP segment containing the HTTP POST command? Note that in order to find the POST command, you’ll need to dig into the packet content field at the bottom of the Wireshark window, looking for a segment with a “POST” within its DATA field.Ans: The sequence number : 17. Consider the TCP segment containing the HTTP POST as the first segment in the TCP connection. What are the sequence numbers of the first six segments in the TCP connection (including thesegment containing the HTTP POST)? At what time was each segment sent? When was the ACK for each segment received? Given the difference between when each TCP segment was sent, and when its acknowledgement was received, what is the RTT value for each of the six segments? What is the EstimatedRTT value (see page 249 in text) after the receipt of each ACK? Assume that the value of the EstimatedRTT is equal to the measured RTT for the first segment, and then is computed using the EstimatedRTT equation on page 249 for all subsequent segments.Note: Wireshark has a nice feature that allows you to plot the RTT for each of the TCP segments sent. Select a TCP segment in the “listing of captured packets” window that is being sent from the client to the server. Then select: Statistics->TCP Stream Graph- >Round Trip Time Graph.Segment 1 Segment 2 Segment 3Segment 4Segment 5Segment 6After Segment 1 : EstimatedRTT = 0.02746After Segment 2 : EstimatedRTT = 0.875 * 0.02746 + 0.125*0.035557 = 0.028472 After Segment 3 : EstimatedRTT = 0.875 * 0.028472 + 0.125*0.070059 = 0.033670 After Segment 4 : EstimatedRTT = 0.875 * 0.033670 + 0.125*0.11443 = 0.043765 After Segment 5 : EstimatedRTT = 0.875 * 0.043765 + 0.125*0.13989 = 0.055781 After Segment 6 : EstimatedRTT = 0.875 * 0.055781 + 0.125*0.18964 = 0.072513 8. What is the length of each of the first six TCP segments?(see Q7)9. What is the minimum amount of available buffer space advertised at the received for the entire trace? Does the lack of receiver buffer space ever throttle thesender?ANS:The minimum amount of buffer space (receiver window) advertised at for the entire trace is 5840 bytes;This receiver window grows steadily until a maximum receiver buffer size of 62780 bytes.The sender is never throttled due to lacking of receiver buffer space by inspecting this trace.10. Are there any retransmitted segments in the trace file? What did you check for (in the trace) in order to answer this question?ANS: There are no retransmitted segments in the trace file. We can verify this by checking the sequence numbers of the TCP segments in the trace file. All sequence numbers are increasing.so there is no retramstmitted segment.11. How much data does the receiver typically acknowledge in an ACK? Can youidentify cases where the receiver is ACKing every other received segment (seeTable 3.2 on page 257 in the text).ANS: According to this screenshot, the data received by the server between these two ACKs is 1460bytes. there are cases where the receiver is ACKing every other segment 2920 bytes = 1460*2 bytes. For example 64005-61085 = 292012. What is the throughput (bytes transferred per unit time) for the TCP connection? Explain how you calculated this value.ANS: total amount data = 164091 - 1 = 164090 bytes#164091 bytes for NO.202 segment and 1 bytes for NO.4 segmentTotal transmission time = 5.455830 – 0.026477 = 5.4294So the throughput for the TCP connection is computed as 164090/5.4294 = 30.222 KByte/sec.13. Use the Time-Sequence-Graph(Stevens) plotting tool to view the sequence number versus time plot of segments being sent from the client to the server. Can you identify where TCP’s slow start phase begins and ends, and where congestion avoidance takes over? Comment on ways in which the measured data differs from the idealized behavior of TCP that we’ve studied in the text.ANS: Slow start begins when HTTP POST segment begins. But we can’t identify where TCP’s slow start phase ends, and where congestion avoidance takes over.14. Answer each of two questions above for the trace that you have gathered when you transferred a file from your computer to ANS: Slow start begins when HTTP POST segment begins. But we can’t identify where TCP’s slow start phase ends, and where congestion avoidance takes over.。
苏教版小学科学3-6年级实验答案实验一:水的性质实验目的1. 认识水的性质,了解水在不同条件下的表现。
2. 培养学生的观察和思考能力。
实验材料1. 蒸馏水2. 玻璃杯3. 冰块4. 温度计5. 盐实验步骤1. 将等量的蒸馏水倒入两个玻璃杯中。
2. 将一个玻璃杯放入冰箱冷冻,制成冰块。
3. 将另一个玻璃杯加热,使其温度升高。
4. 观察并记录两个玻璃杯中水的状态变化。
5. 将冰块取出,观察冰块融化成水的过程。
6. 在其中一个玻璃杯中加入适量的盐,观察水的状态变化。
实验现象与结论1. 冷冻后的水变成冰块,说明水在低温下会凝固。
2. 加热后的水会蒸发,形成水蒸气,说明水在高温下会蒸发。
3. 冰块融化成水,说明冰在一定温度下会融化。
4. 加入盐后的水会结冰,说明盐可以使水的凝固点降低。
实验二:光的传播实验目的1. 了解光的传播原理,认识光的传播路径。
2. 培养学生的观察和分析能力。
实验材料1. 激光笔2. 白色屏幕3. 透明塑料尺4. 直尺实验步骤1. 关闭房间内的灯光,确保实验环境黑暗。
2. 使用激光笔向白色屏幕射出一束光。
3. 观察并记录光在屏幕上的传播路径。
4. 将透明塑料尺放在光束路径上,观察光在塑料尺上的传播情况。
5. 改变塑料尺的位置,观察光束的传播路径是否发生改变。
实验现象与结论1. 光在黑暗的环境中沿直线传播,形成一束明亮的光线。
2. 光在透明塑料尺上传播时,传播路径不变,说明光在透明介质中沿直线传播。
3. 当改变塑料尺的位置时,光束的传播路径发生改变,说明光的传播路径可被障碍物影响。
实验三:力的作用实验目的1. 了解力的概念,认识力的作用效果。
2. 培养学生的动手操作能力。
实验材料1. 弹簧测力计2. 绳子3. 重物4. 木块5. 光滑的桌面实验步骤1. 将弹簧测力计固定在光滑的桌面上。
2. 用绳子连接弹簧测力计和重物。
3. 测量并记录重物的重力。
4. 将重物放在木块上,用弹簧测力计拉动木块,使重物在桌面上移动。
实验三 选择结构程序设计一、实验目的与要求1. 理解C 语言表示逻辑量的方法,学会正确使用逻辑运算符和逻辑表达式。
2. 掌握利用if 结构实现选择结构的方法。
3. 掌握利用switch 结构实现多分支选择结构。
4. 结合程序掌握一些简单的算法,学习调试程序5. 实验4学时二、实验内容1.程序改错题改正下面程序中的错误。
输入实数x ,计算并输出下列分段函数f(x)的值(保留1位小数)。
)100(1=x x==)(x f y)100(≠x x输入输出示例1(改正后程序的运行结果)Enter x :100f )=输入输出示例2(改正后程序的运行结果)Enter x :23f )=源程序(有错误的程序)#include<>#include<>void main(void){double x;printf("Enter x: \n");scanf("=%f", x);if (x = 100) {y = 1/sqrt(x)}else (x != 100) {y = x;}printf("f(%.2f) = %.1f\n",x,y);}答:#include<>#include<>void main(void){double x,y;printf("Enter x:\n");scanf("%lf",&x);if (x=100)y = 1/sqrt(x);elsey= x;printf("f(%.2lf)=%.1lf\n",x,y);}2.一般编程题编程题1输入任意三个整数a,b,c ,求3个数中的最大值和最小值。
答:#include <>void main(){int a,b,c;printf("请输入三个整数:");scanf("%d %d %d",&a,&b,&c);if (a>=b)t=a,a=b,b=t;if (a>=c)t=a,a=c,c=t;if (b>=c)t=b,b=c,c=t;printf("最小值为:%d\n",a);printf("最大值为:%d\n",c);}编程题2输入x ,计算并输出下面分段函数f(x)的值(保留2位小数)。
实验三一、某小学26位学生(11岁)的身高(单位:cm)如下:126(女)149(男)143(女)141(男)127(女)137(男)132(男)137(男)132(女)135(女)134(男)146(男)142(女)135(男)141(男)150(男)137(女)144(男)137(女)134(女)139(男)148(男)144(女)142(女)137(女)147(男)1、计算身高各种描述性指标;2、分男女输出身高的均值、方差、标准差。
二、针对数据Empolyee data.sav,1、输出当前薪金的基本描述性统计量,并对不同性别进行比较。
参考答案:第一步:操作过程分析-----描述统计----探索第二步:结果显示不同性别比较时方法同上,只是在因子列表中输入gender2、输出不同性别不同工作类型的当前薪金的均值,方差,标准差及中位数。
参考答案:第一步:操作过程分析-----比较均值-----均值第二步:结果显示:3、分析当前薪金是否存在不均衡现象。
参考答案:第一步:操作过程(1)分析-----描述统计-----描述(2)转换----可视离散化(3)分析-----描述统计----频率第二步:结果显示第三步:结果解释结果显示,低收入组为0%,高收入组占2.1%,收入异常组的总比例大于理论值0.3%,所以可以认为当前薪金存在一定的不均衡现象。
4、输出不同性别和不同工作类型交叉分组下的职工频数分布情况。
(在分析----描述统计----交叉表里完成)三、下表为甲乙两地被访者对互联网的使用情况,请绘制饼图。
地区每天上网经常上网偶尔上网从不上网甲地乙地49(19.84%)62(21.83%)92(37.25%)113(39.79%)65(26.32%)67(23.59%)41(16.6%)42(14.79%)参考答案:第1步数据视图:第2步变量视图:第3步操作步骤(1)【数据→加权个案】(2)【图形→旧对话框→饼图】【定义】【确定】(3)进入图形编辑界面:第4步结果分析:(同学们自己书写)四、为研究个人矽肺患病率与工龄的关系,某市疾病控制中心收集了以下数据,。
实验三数据查询(参考答案)实验目的□学会利用T_SQL语句中SELECT进行数据查询。
□掌握利用T_SQL 语句进行数据查询的基本方法。
实验内容有以下数据表表名:tudent属性列t_idt_nmt_e某t_birtht_coret_datet_fromt_dpidt_mnt使用T-SQL语句进行数据查询(注:学生班级为学号的前6位)1.显示所有学生的学号、姓名、性别、入学年份和班级(学号前6位)。
Selectt_id学号,t_nm姓名,t_e某性别,year(t_date)入学年份,left(t_id,6)班级Fromtudent2.显示前25%条学生记录信息。
Selecttop25percent某fromtudent3.查询tudent表中2022年及以后入学的学生信息。
Select某fromtudentwhereyear(t_date)>=20224.查询选修了1002号课程且成绩在60以下的学生学号。
Selecttudent.t_idfromtudentjoinlt_coueontudent.t_id=lt_coue. t_idWherec_id='1002'andcore<605.查询所有由三个字组成的“王”姓学生信息。
Select某fromtudentwheret_nmlike'王__'6.查询选修了1001号课程且成绩在60到80之间的学生选课信息。
Select某fromlt_couewherec_id='1001'andcorebetween60and807.查询所有张,王,李,赵姓的学生的学号、姓名、性别。
Selectt_id,t_nm,t_e某fromtudentwheret_nmlike'[张王李赵]%'8.查询陕西籍学生,将结果保存在新表t_han某i。
Select某intot_han某ifromtudentwheret_fromlike'%陕西%'9.查询选修了“数据结构”课程的学生学号、姓名及课程成绩。
大学物理实验第二版第3册课后练习题含答案前言大学物理实验是大学物理的重要组成部分,通过实验可以加深对物理知识的理解,并培养实验能力和科学精神。
掌握大学物理实验的技能对学生未来从事相关领域的工作和研究具有重要的帮助。
本文将为大家提供大学物理实验第二版第3册的课后练习题,其中还包含了答案供大家参考。
课后练习题实验一答案1.望远镜通过调节焦距可以使得远处的物体像变清晰。
2.擦拭物镜和目镜的透镜,调节合适焦距即可。
3.(略)实验二答案1.$sin\\theta_1=n \\cdot sin\\theta_2$2.$n=\\frac{sin\\theta_1}{sin\\theta_2}=1.48$3.(略)实验三答案1.声压级L的单位是分贝,$L=10log\\frac{p}{p_0}$,其中p0为参考压强,$p_0=2 \\times 10^{-5} Pa$。
2.$L_2-L_1=10log\\frac{p_2}{p_1}=10log\\frac{d_1^2}{d_2^2}=10log(\\frac{0 .58^2}{1.00^2})=-4.07dB$3.分贝的单位不仅可以用于声压级的表示,也可以用于其他物理量的表示,如电压、功率等。
实验四答案1.通过调节功率可以控制液晶显示屏的亮度,使其达到最佳显示效果。
2.(略)3.在夜晚使用液晶显示屏的亮度应该适当降低,以免刺眼的光线照射到车外影响其他驾车人的视线。
实验五答案1.环状光路的长度为$L=2\\pi r$。
2.通过调节镜头位置可以改变光路的长度,从而改变干涉条纹的位置和数量。
3.(略)实验六答案1.通过调节球面镜、平面镜的位置,以及反光板的角度可以改变光路的长度、方向,从而实现干涉实验。
2.洛伦兹-费歇实验可以测量电子的速度和能量。
3.(略)结语本文为大家提供了大学物理实验第二版第3册的课后练习题,其中还包含了答案供大家参考。
希望本文能够帮助大家更好地掌握物理实验的知识和技能。
实验三循环控制实验课程名:高级语言程序设计(C)专业班级:学号:姓名:实验时间:实验地点:指导教师:一、实验目的和要求1. 熟练掌握用while语句、do while语句和for语句实现循环的方法。
2. 掌握在程序设计中用循的方法实现一些常用算法。
并进一步学习调试程序的方法。
二、实验内容1、任务名称程序c40101.c求1+…+100,填空,实现该功能。
(1、)源代码:#include<stdio.h>int main(){int s,i;s=0;for(i=1;i<=100;i++)s=s+i;printf("1+2+...+100=%d\n",s);return 0;}运行结果:(需要截图)(2、)源代码:#include<stdio.h>int main(){int s=0,i=1;while(i<=100){s+=i;i++;}printf("1+2+...+100=%d\n",s);return 0;}运行结果:运行结果分析:2、任务名称:分别运行这两个程序,若输入7,这两个程序的结果分别是多少?若输入12,这两个程序的结果又分别是多少?比较为什么会有这样的区别?(1、)源代码:#include <stdio.h>void main(){ int i,n,sum=0;scanf("%d",&i);n=i;while(i<=10){ sum+=i;i++;}printf("%d+...+10=%d\n",n,sum);}运行结果:(需要截图)(2、)源代码:#include <stdio.h>int main(){ int i,n,sum=0;scanf("%d",&i);n=i;do{ sum+=i;i++;} while(i<=10);printf("%d+...+10=%d\n",n,sum);return 0;}运行结果:运行结果分析:3、任务名称:下面程序,若输入12345,分析输出结果是多少?源代码:#include <stdio.h>void main( ){ long data;scanf("%ld",&data);while(data){ printf("%ld,",data%10);data=data/10;}}运行结果:(需要截图)运行结果分析:4、任务名称:程序c40104.c 实现求Fibonacci 数列的前n 个数。
Matlab实验三答案实验三 MATLAB语⾔的程序设计⼀、实验⽬的:1、熟悉MATLAB程序编辑与设计环境2、掌握各种编程语句语法规则及程序设计⽅法3、函数⽂件的编写和设计4、了解和熟悉跨空间变量传递和赋值⼆、实验基本知识:1、程序流程控制语句for循环结构语法:for i=初值:增量:终值语句1……语句nend说明:1.i=初值:终值,则增量为1。
2.初值、增量、终值可正可负,可以是整数,也可以是⼩数,只须符合数学逻辑。
while 循环结构语法:while 逻辑表达式循环体语句end说明:1、whiIe结构依据逻辑表达式的值判断是否执⾏循环体语勾。
若表达式的值为真,执⾏循环体语句⼀次、在反复执⾏时,每次都要进⾏判断。
若表达式的值为假,则程序执⾏end之后的语句。
2、为了避免因逻辑上的失误,⽽陷⼊死循环,建议在循环体语句的适当位置加break语句、以便程序能正常执⾏。
(执⾏循环体的次数不确定;每⼀次执⾏循环体后,⼀定会改变while 后⾯所跟关系式的值。
)3、while循环也可以嵌套、其结构如下:while逻辑表达式1循环体语句1while逻辑表达式2循环体语句2end循环体语句3endelse if 表达式2(可选)语句2else(可选)语句3endend说明:1.if结构是⼀个条件分⽀语句,若满⾜表达式的条件,则往下执⾏;若不满⾜,则跳出if结构。
2.else if表达式2与else为可选项,这两条语句可依据具体情况取舍。
3.注意:每⼀个if都对应⼀个end,即有⼏个if,记就应有⼏个end。
switch-case结构语法:switch表达式case常量表达式1语句组1case常量表达式2语句组2……otherwise语句组nend说明:1.switch后⾯的表达式可以是任何类型,如数字、字符串等。
2.当表达式的值与case后⾯常量表达式的值相等时,就执⾏这个case后⾯的语句组如果所有的常量表达式的值都与这个表达式的值不相等时,则执⾏otherwise后的执⾏语句。
实验三循环结构程序设计(参考答案)1、设计程序sy3-1.c,计算并输出n(包括n)以内所有能被5或9整除的自然数的倒数之和。
例如输入n 的值为20时,输出0.583333。
算法分析:穷举1~n(含n)之间的每一个整数,能否被5或者9整除。
如果能,则把它的倒数累加到累加器里去。
因为能被5整除的自然数,应该至少从5才可能,所以循环控制变量i可以5开始。
参考答案:#include<stdio.h>void main(){int n,i;double s=0; //累加器要赋初值为0,结果为小数,所以定义为实数类型printf("请输入n的值:");scanf("%d",&n);for(i=5;i<=n;i++) //穷举小于等于n的自然数if(i%5==0||i%9==0)s=s+1.0/i;// 因为i是整数类型,所以1/i的值为0printf("s=%f\n",s);}运行结果:2、设计程序sy3-2.c,计算并输出给定整数n的所有因子(不包括1与自身)之和。
例如,输入n的值是856时,应输出763。
算法分析:因子,就是能整除n的值。
所以从2到n-1穷举每个数是不是它的因子,是就累加到s中。
参考答案:#include<stdio.h>void main(){int s=0,n,i;printf("请输入n:");scanf("%d",&n);for(i=2;i<n;i++) //穷举所有可能为因子的整数if(n%i==0) //因子即是能整除n的数s=s+i;printf("%d的所有因子之和是:%d\n",n,s);}运行结果:3、设计程序sy3-3.c,输入一个整数,要求将该整数上各位数字是偶数的数取出,并按原来从高位到低位的顺序组成一个新数。
上海电力学院实验报告课程名称高级程序设计C++(2)实验项目实验3 多态性应用姓名学号班级专业同组人姓名无指导教师姓名卢芳芳实验日期2014年4月30日一、实验目的通过编程实践,理解运算符重载的意义深刻理解运算符重载的概念掌握运算符重载的实现方法虚函数的应用二、实验内容和步骤1.定义点坐标类Point,用成员函数重载++(自增)运算符实现横纵坐标值均加1,用友元函数重载--(自减)运算符,实现横纵坐标值均减1。
●程序源代码(注意添加注释)#include<iostream>using namespace std;class Point{public:Point& operator++(); //前置++Point operator++(int); //后置++friend Point& operator--(Point& t); //前置--friend Point operator--(Point& t, int); //前置--Point(double x=0,double y=0){this->x=x;this->y=y;}int getx(){return x;}int gety(){return y;}private:double x,y;};Point& Point::operator++(){x++;y++;return *this;}Point Point::operator ++(int) {Point temp=*this;this->x++;this->y++;return temp;}Point& operator --(Point& t) {t.x--;t.y--;return t;}Point operator --(Point& t, int) {Point temp=t;t.x--;t.y--;return temp;}int main(){Point A(1,2),B(0,0);cout<<"A的值为"<<A.getx()<<","<<A.gety()<<endl;A++;cout<<"A的值为"<<A.getx()<<","<<A.gety()<<endl;B=(A++)++;cout<<"A的值为"<<A.getx()<<","<<A.gety()<<endl;cout<<"B的值为"<<B.getx()<<","<<B.gety()<<endl;++A;cout<<"A的值为"<<A.getx()<<","<<A.gety()<<endl;B=++(++A);cout<<"A的值为"<<A.getx()<<","<<A.gety()<<endl;cout<<"B的值为"<<B.getx()<<","<<B.gety()<<endl;A--;cout<<"A的值为"<<A.getx()<<","<<A.gety()<<endl;--A;cout<<"A的值为"<<A.getx()<<","<<A.gety()<<endl;return 0;}运行结果(直接截取结果图)2.编写一个复数类并在该类中添加两个运算符重载函数,一个为成员函数实现两个复数加法,一个为友元函数实现两个复数乘法。
并写出两个运算符重载函数的实现代码。
complex.h#include<iostream>using namespace std;class Complex{double real,image;public:void set();void show();Complex operator+(const Complex &b);friend Complex operator*(const Complex &a,const Complex &b);};complex.cpp#include<iostream>#include"clock.h"using namespace std;void Complex::set(){cout<<"请输入复数的实部:"<<endl;cin>>real;cout<<"请输入复数的虚部:"<<endl;cin>>image;}void Complex::show(){if(real==0){if(image==0)cout<<"复数为:0"<<endl;elsecout<<"复数为:"<<image<<"i"<<endl;}else{if(image==0)cout<<"复数为:"<<real<<endl;elseif(image>0)cout<<"复数为:"<<real<<"+"<<image<<"i"<<endl;elsecout<<"复数为:"<<real<<"-"<<-image<<"i"<<endl;}}Complex Complex::operator+(const Complex &b){Complex x;x.real=real+b.real;x.image=image+b.image;return x;}Complex operator*(const Complex &a,const Complex &b){Complex x;x.real=a.real*b.real-a.image*b.image;x.image=a.real*b.image+a.image*b.real;return x;}main.cpp#include<iostream>#include"clock.h"using namespace std;void main(){Complex a,b,c;a.set();cout<<"复数a的值为:";a.show();b.set();cout<<"复数b的值为:";b.show();c=a+b;cout<<"复数c=a+b,复数c的值为:";c.show();c=a*b;cout<<"复数c=a*b,复数c的值为:";c.show();}3.类clock有三个整型私有成员hour,minute,second,请重载其前置--运算符为类clock的成员函数,实现clock对象的自加1操作,重载运算符<<和>>,实现时间对象的输出,输出格式为hh:mm:ss,请完成相关类定义,函数实现。
●程序源代码(注意添加注释)●clock.h#include<iostream.h>class clock{private:int hour,minute,second;public:clock& operator--();friend ostream& operator<<(ostream& out,clock &a);friend istream& operator>>(istream& in,clock &a);};clock.cpp#include<iostream.h>#include"clock.h"clock& clock::operator--(){--second;if(second<0) {second=59;--minute;}if(minute<0) {minute=59;--hour;}if(hour<0) {hour=23;}return *this;}istream& operator>>(istream& in,clock &a){cout<<"请输入合法的(时hour):"<<endl;while(true){in>>a.hour;if(a.hour>=0&&a.hour<=24)break;elsecout<<"时输入错误,请重新输入。
"<<endl;}cout<<"请输入合法的(分minute): "<<endl;while(true){in>>a.minute;if(a.minute>=0&&a.minute<=60)break;elsecout<<"分输入错误,请重新输入。
"<<endl;}cout<<"请输入合法的(秒second): "<<endl;while(true){in>>a.second;if(a.second>=0&&a.second<=60)break;elsecout<<"秒输入错误,请重新输入。