搜索结果
查询Tags标签: cout,共有 1241条记录-
2021-10-03【黑马程序员】封装设计案例1--立方体内-----个人改动版
#include<iostream> using namespace std; class Cube { private: int m_L; int m_W; int m_H; public: void setL(int l) { m_L = l; } int getL() { return m_L; }void setW(int w) { m_W = w; …
2021/10/3 22:11:38 人评论 次浏览 -
2021-10-03【黑马程序员】封装设计案例1--立方体内-----个人改动版
#include<iostream> using namespace std; class Cube { private: int m_L; int m_W; int m_H; public: void setL(int l) { m_L = l; } int getL() { return m_L; }void setW(int w) { m_W = w; …
2021/10/3 22:11:38 人评论 次浏览 -
C++学习:第一阶段(C++基础入门)
C++基础入门 1 C++初识 1.1 第一个C++程序 #include<iostream> using namespace std;int main() {cout << "Hello world" << endl;system("pause");return 0; }1.2 注释 作用:在代码中加一些说明和解释,方便自己或其他程序员程序…
2021/10/3 20:14:07 人评论 次浏览 -
C++学习:第一阶段(C++基础入门)
C++基础入门 1 C++初识 1.1 第一个C++程序 #include<iostream> using namespace std;int main() {cout << "Hello world" << endl;system("pause");return 0; }1.2 注释 作用:在代码中加一些说明和解释,方便自己或其他程序员程序…
2021/10/3 20:14:07 人评论 次浏览 -
c++桥接模式
范例一: #include <iostream> #include <thread>#ifdef _DEBUG //只在Debug(调试)模式下 #ifndef DEBUG_NEW #define DEBUG_NEW new(_NORMAL_BLOCK,__FILE__,__LINE__) //重新定义new运算符 #define new DEBUG_NEW #endif #endifusing namespace std; //…
2021/10/3 11:10:04 人评论 次浏览 -
c++桥接模式
范例一: #include <iostream> #include <thread>#ifdef _DEBUG //只在Debug(调试)模式下 #ifndef DEBUG_NEW #define DEBUG_NEW new(_NORMAL_BLOCK,__FILE__,__LINE__) //重新定义new运算符 #define new DEBUG_NEW #endif #endifusing namespace std; //…
2021/10/3 11:10:04 人评论 次浏览 -
2021PAT甲级秋季考试题解
7-1Arrays and Linked Lists#include<bits/stdc++.h> using namespace std; const int N = 1e4+10; struct L{int address;int len; }link[N]; int sum[N]; int main() {int n,k;int total = 0;cin >> n >> k;for(int i = 0 ; i < n ; i ++){cin >…
2021/10/2 23:14:23 人评论 次浏览 -
2021PAT甲级秋季考试题解
7-1Arrays and Linked Lists#include<bits/stdc++.h> using namespace std; const int N = 1e4+10; struct L{int address;int len; }link[N]; int sum[N]; int main() {int n,k;int total = 0;cin >> n >> k;for(int i = 0 ; i < n ; i ++){cin >…
2021/10/2 23:14:23 人评论 次浏览 -
ACM/ICPC 2019 NENA C. Cutting the Necklace(前缀和 + 暴力二分)
好像中文互联网没有相关内容? 题意是给出一个数组能否k等分其子数组,使得k个子段和一样 当时想的有点难了,主要是感觉这算是个经典问题,就上网搜,搜了半天发现lc只有一个用dfs找的 dfs爆搜能行么?肯定不行,这1e7数据是开玩笑的?然后就歪了,当时想的是维护一个滑动…
2021/10/2 6:11:01 人评论 次浏览 -
ACM/ICPC 2019 NENA C. Cutting the Necklace(前缀和 + 暴力二分)
好像中文互联网没有相关内容? 题意是给出一个数组能否k等分其子数组,使得k个子段和一样 当时想的有点难了,主要是感觉这算是个经典问题,就上网搜,搜了半天发现lc只有一个用dfs找的 dfs爆搜能行么?肯定不行,这1e7数据是开玩笑的?然后就歪了,当时想的是维护一个滑动…
2021/10/2 6:11:01 人评论 次浏览 -
[算法竞赛进阶指南]64位整数乘法
传送门 code #include<bits/stdc++.h> using namespace std; unsigned long long a,b,c;//int main() {cin>>a>>b>>c;unsigned long long ans=0,now=a;//while(b>0){if(b&1){ans=(ans+now)%c;}now=now*2%c;b>>=1;}ans%=c;cout<&…
2021/10/2 1:11:08 人评论 次浏览 -
[算法竞赛进阶指南]64位整数乘法
传送门 code #include<bits/stdc++.h> using namespace std; unsigned long long a,b,c;//int main() {cin>>a>>b>>c;unsigned long long ans=0,now=a;//while(b>0){if(b&1){ans=(ans+now)%c;}now=now*2%c;b>>=1;}ans%=c;cout<&…
2021/10/2 1:11:08 人评论 次浏览 -
C++ STL 容器的合并、求差集、交集等操作实例
//本实例程序演示容器之间合并、求差集、求交集//merge、inplace_merge、set_union、set_difference、set_intersection、#include <iostream>#include <list>#include <set>#include <algorithm>#include <iterator>using namespace std;/…
2021/10/2 1:11:04 人评论 次浏览 -
C++ STL 容器的合并、求差集、交集等操作实例
//本实例程序演示容器之间合并、求差集、求交集//merge、inplace_merge、set_union、set_difference、set_intersection、#include <iostream>#include <list>#include <set>#include <algorithm>#include <iterator>using namespace std;/…
2021/10/2 1:11:04 人评论 次浏览 -
剑指offer_剪绳子(C++_动态规划/图解贪心算法)
原题链接文章目录 动态规划1.思路2.动态规划C++代码3.代码注意贪心算法1.思路①证明一②证明二2.C++贪心算法代码动态规划 1.思路 可以分析出来,因为题目要求必须剪。当绳子的长度小于2的时候不能剪了,这里返回0。当长度为2时只能11,乘积为1。当长度为3时最大乘积为12=…
2021/9/29 20:41:13 人评论 次浏览