首页 > 其他分享 >5.11

5.11

时间:2023-05-11 21:56:23浏览次数:29  
标签:++ zhong miao fen int 5.11 shi

 1 #include<iostream>
 2 using namespace std;
 3 class zhong
 4 {
 5 private:
 6     int shi;
 7     int fen;
 8     int miao;
 9 public:
10     zhong operator++()
11     {
12         miao++;
13         if(miao==60)
14         {
15             fen++;
16             miao=0;
17         }
18         if(fen==60)
19         {
20             shi++;
21             fen=0;
22         }
23         if(shi==24) shi=0;
24         return *this;
25     }
26     zhong operator++(int)
27     {
28         zhong a=*this;
29         ++*this;
30         return a;
31     }
32     friend istream& operator>>(istream& input,zhong& a)
33     {
34         input>>a.shi>>a.fen>>a.miao;
35         return input;
36     }
37     friend ostream& operator<<(ostream& output,zhong& a)
38     {
39         output<<a.shi<<":"<<a.fen<<":"<<a.miao;
40         return output;
41     }
42 };
43 int main()
44 {
45     zhong a;
46     cin>>a;
47     a++;
48     cout<<a;
49 }

 

标签:++,zhong,miao,fen,int,5.11,shi
From: https://www.cnblogs.com/lijianlongCode13/p/17392363.html

相关文章

  • 5.11每日总结
    hasNextXxx():判断下一个输入是否是某种类型的元素如:hasNextInt(),hasNextFloat()、hasNextDouble()等hasNest():判断下一个输入是否是字符串nextXxx():用于获取下一个输入项如:nextInt、nextFloat、nextDouble等next():用于读取String字符串数组,以空格划分(只读取输入直到空格),在读取后将光......
  • 2023.5.11每日总结
    packageget;importorg.apache.commons.fileupload.FileItem;importorg.apache.commons.fileupload.FileUploadException;importorg.apache.commons.fileupload.disk.DiskFileItemFactory;importorg.apache.commons.fileupload.servlet.ServletFileUpload;importj......
  • 每日总结-23.5.11
    <%@pageimport="wangzhan.Thesql"%><%@pageimport="wangzhan.Pd_P_assignment"%><%@pageimport="wangzhan.Pd_S_assignment"%><%@pageimport="wangzhan.Pd_lesson"%><%@pagelanguage=&......
  • flower in 5.11
    在此,我想探讨一下多项式全家桶应该怎么封装、封装成什么程度的问题。我所认为的多项式全家桶应当是一种全面而又精简、快速而不冗长的一种代码块。最早看到的所谓“多项式全家桶”是Delov半年多前的《简单封装Poly》。非常优雅的马蜂。确实非常优雅的马蜂,相当精简,可读性也极强......
  • 5.11
    #include<iostream>#include<string>usingnamespacestd;classPerson{public:Personoperator+(Person&p){Personp3;p3.a=this->a+p.a;p3.b=this->b+p.b;returnp3;}inta;intb;};Personoperator+(Person&p1,Person&......
  • 每日总结 5.11
    <!doctypehtml><html><head><metacharset="UTF-8"><scripttype='text/javascript'>if(document.createElement("input").webkitSpeech===undefined){ale......
  • 2023.5.11编程一小时打卡
    一、问题描述:完成“学生cpp成绩计算”之后,修改Person和Student类,各自增加两个无参构造函数。仍以Person类为基础,建立一个派生类Teacher,增加以下成员数据:intID;//教师工号Studentstu[100];//学生数组intcount;//学生数目,最多不超过100floatcpp_average;//班......
  • 5.11 2.6
    一、问题描述一辆以固定速度行驶的汽车,司机在上午10点看到里程表上的读数是一个对称数(即这个数从左向右读和从右向左读是完全一样的),为95859。两小时后里程表上出现了一个新的对称数,该数仍为五位数。问该车的速度是多少?新的对称数是多少?二、分析司机在上午10点看到里程表......
  • 5.11
    #include<stdio.h>main(){inti,j,s,n;printf("请输入所选范围上限:");scanf("%d",&n);for(i=2;i<=n;i++){s=0;for(j=1;j<i;j++){if(i%j==0)s+=j;}if(s==i)printf("Itisaperfectnumber:%d.\n",i);}}......
  • 5.11总结
    DropTABLEIFEXISTStb_order;DropTABLEIFEXISTStb_goods;--订单表--表实现多对多--实现方式:建立第三方中间表,中间表至少包含两个外键,分别关联两方主键CREATETABLEtb_order(idINTprimarykeyauto_increment,paymentDOUBLE(10,2),payment_typeTINYINT,sta......