摘要:
1.重载的意义:类之间的运算。 2.示例: <1>类中定义 1 bool operator==(const class& p) 2 { 3 if(this->x==p.x) return true; 4 else return false; 5 } <2>类外定义(左操作数的参数必须显示指定) bo 阅读全文
posted @ 2020-03-15 12:05
李润一
阅读(232)
评论(0)
推荐(0)
摘要:
1.类型问题: int x=1; x=x*1.1; cout<<x<<endl; 输出的x是1,因为x为int类型。 此时即使加上(double)类型转换也无法输出1.1 2.函数的默认参数: 1 #include <iostream> 2 using namespace std; 3 class 阅读全文
posted @ 2020-03-15 11:15
李润一
阅读(109)
评论(0)
推荐(0)
摘要:
1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn=110; 4 struct P 5 { 6 int x,y; 7 }c[maxn];//记录路径 8 char fz[maxn][maxn],stand[]="yiz 阅读全文
posted @ 2020-03-15 10:56
李润一
阅读(233)
评论(0)
推荐(0)
摘要:
这是我的第一篇博文。 本博客主要分享博主的计算机学习笔记,不定期更新。 Hello,world! 阅读全文
posted @ 2020-03-07 19:40
李润一
阅读(161)
评论(0)
推荐(0)
浙公网安备 33010602011771号