E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
cout
C/C++有序数组中插入元素
一、不利用指针代码:inti;voidinsert(int,int,int);intmain(){inta[100];intn,m;
cout
>n;
cout
>a[i];}
cout
>m;insert(a,n
Zik----
·
2024-02-26 23:36
算法
数据结构
c语言
c++
C++11 引入的新的构造函数和语言特性
例如:classMyClass{public:MyClass(){std::
cout
name=name;}Person(stringname,intage):Person(name){//委托构造函数this
光风霁月023
·
2024-02-26 14:07
C primer plus 复习题答案 上
复习题答案上第二章第三章第四章第五章第六章第二章c++程序的模块叫做函数预处理器编译指令是用作替换编译指令可以使用程序再std空间内的各定义
cout
>cheeses;
cout
actor;arraybetsie
不好,商鞅要跑
·
2024-02-25 20:32
c++
primer
plus
c语言
c++
算法
用C++做简易版和平精英
include#include#include#includeusingnamespacestd;voidjun(){system("exportTERM=xterm&&clear");sleep(1.5);
cout
AI迅剑
·
2024-02-24 11:29
c++
CF 1921E
#includeusingnamespacestd;voidsolve(){inth,w,xa,ya,xb,yb;cin>>h>>w>>xa>>ya>>xb>>yb;if(xa==xb){
cout
xb)
三冬四夏会不会有点漫长
·
2024-02-23 16:04
#
1600
算法
C++数据结构:队列模板
intq[100010];inthead=0,tail=0;public:voidpush(intx){//加入队尾q[tail++]=x;}voidfront(){//查看队头if(head==tail)
cout
UESTC_KS
·
2024-02-23 12:30
C++
c++
数据结构
算法
2.20号qt
1.Qt中的信息调试类(输出类)QDebug//1.类似与printfqDebug("%s","hellokittiy");//2.类似与
cout
默认有换行比较常用的方式qDebug()setWindowTitle
&李维佳
·
2024-02-20 20:26
笔记
《白话C++》第10章 STL和boost,Page101 10.4.6 std::weak_ptr
对应前面的C1、C2,我们写一个弱引用版本的C3和C4的例子:structC4;structC3{~C3(){
cout
_c4;};structC4{~C4(){
cout
_c3;};voidtest_weak_reference
yanzhenxi
·
2024-02-20 20:20
《白话C++》智能指针专辑
《白话C++》学习
《白话C++》第10章
STL和boost
c++
开发语言
单调栈C++(Acwing)
tt;intmain(){cin.tie(0);cin>>n;for(inti=0;i>x;while(tt&&stk[tt]>=x)tt--;//如果栈顶大于x就删掉,直到找到小于x的元素if(tt)
cout
shady1972
·
2024-02-20 18:50
c++
数据结构
算法
快速选择(第k小数)C++ (Acwing)
intquick_sort(intl,intr,intk){if(l==r)returnq[l];intx=q[l],i=l-1,j=r+1;while(ix);if(i>n>>k;for(inti=0;i>q[i];
cout
shady1972
·
2024-02-20 18:20
c++
算法
数据结构
C++:想要指定输出所占列数的方法 setw(n)
举例:
cout
<<"a="<
cout<<"b="<
摘星星的月亮.
·
2024-02-20 18:16
c++
java
前端
NS安装-CentOS服务器安装Nights
cout
CGM
NSCGM安装必要条件有自己的云服务器好像没有2,有云服务器就行了安装顺序先安装数据库,目前支持的是MongoDB,官方推荐4,其实目前最新版本就行。可以用宝塔安装,比较简单克隆代码,我是放到/opt/ns目录中了安装nodejs,进入代码目录,运行npminstall启动cgm具体代码yuminstallepel-releasecurl-o-https://raw.githubuserconte
懒是一种态度
·
2024-02-20 17:55
服务器
运维
cgm
nightscout
C++random库多次生成的随机数一样解决方法
代码如下:#include#includeusingnamespacestd;intmain(){random_devicerd;mt19937g(rd());for(intn=0;n<10;++n){
cout
羊角问蕊
·
2024-02-20 15:16
c++
算法
开发语言
LeetCode刷题计划
leetcode-master卡码网练习ACM模式https://kamacoder.com/01#includeusingnamespacestd;intmain(){inta,b;while(cin>>a>>b){
cout
usingnamespacestd
小豆包的小朋友0217
·
2024-02-20 15:37
leetcode
算法
职场和发展
2019-07-18
Toutflatteurvitauxdépensdeceluiquil’é
cout
e.
木金木水火土的木
·
2024-02-20 15:05
【C++精简版回顾】1.命名空间2.标准输出3.内联函数与函数重载
1.命名空间(1)创建命名空间namespacedalao{charname[20]="dalao";}(2)使用命名空间intmain(){//使用已有的命名空间时,需加两个英文::std::
cout
b
m0_61659911
·
2024-02-20 14:02
c++
算法
开发语言
代码随想录 Leetcode509. 斐波那契数
三个数表示加法算式里的加数加数和*//*初始化*/intleftVal=0;intrightVal=1;intsum=0;for(inti=2;i<=n;++i){sum=leftVal+rightVal;//递推公式
cout
meeiuliuus
·
2024-02-20 13:32
#
leetcode
---
easy
算法
leetcode
动态规划
蓝桥杯:C++素数、进制转换
代码:#includeusingnamespacestd;intmain(){intn;cin>>n;if(n==1){
cout
usingnamespacestd;//利用两层for循环,第一层遍历2-
DaveVV
·
2024-02-20 12:17
蓝桥杯c++
蓝桥杯
c++
算法
数据结构
c语言
if--c++17--变量+表达式
=v.end()){std::
cout
<
猿饵块
·
2024-02-20 11:09
c++
java
开发语言
2024春晚刘谦魔术代码实现c++
#include#include#includeusingnamespacestd;constintN=8;charch[N],arry[N];;intnum;intmain(){
cout
>ch[i];
big old mouse
·
2024-02-20 11:04
c++
算法
数据结构
【洛谷题解】B2142 求 1+2+3+...+N 的值
15分析:直接套入等差数列求和公式即可AC代码:#includeusingnamespacestd;intmain(){inta;ios::sync_with_stdio(false);//加快cin,
cout
cin
杨智123
·
2024-02-20 10:25
算法
数据结构
【洛谷题解】B2010 带余除法
分析:计算商后再用a/商*b得余数AC代码:#includeusingnamespacestd;intmain(){inta,b;ios::sync_with_stdio(false);//加快cin,
cout
cin
杨智123
·
2024-02-20 10:55
算法
数据结构
【洛谷题解】B2052 简单计算器
分析:直接判断输出即可AC代码:#includeusingnamespacestd;intmain(){inta,b;charc;ios::sync_with_stdio(false);//加快cin,
cout
cin
杨智123
·
2024-02-20 10:55
算法
数据结构
【洛谷题解】B3685 [语言月赛202212] 计算
代码:#includeusingnamespacestd;inta;intsum=0,ans,powsum;intmain(){ios::sync_with_stdio(false);//加快cin,
cout
cin
杨智123
·
2024-02-20 10:24
算法
【洛谷题解】P1134 [USACO3.2] 阶乘问题
代码:#includeusingnamespacestd;intmain(){inta;longlongsum=1;//赋初始值ios::sync_with_stdio(false);//加快cin,
cout
cin
杨智123
·
2024-02-20 10:24
算法
数据结构
【洛谷题解】P8627 [蓝桥杯 2015 省 A] 饮料换购
涉及知识点:换购题意:分析:一直换购直至瓶盖数usingnamespacestd;intmain(){inta,sum=0,ans=0;ios::sync_with_stdio(false);//加快cin,
cout
cin
杨智123
·
2024-02-20 10:23
蓝桥杯
算法
职场和发展
Codeforces Round 925 (Div. 3)
Dashboard-CodeforcesRound925(Div.3)-CodeforcesA.RecoveringaSmallString直接模拟#include#defineIOSios::sync_with_stdio(0);cin.tie(0);
cout
.tie
ros275229
·
2024-02-20 07:44
算法学习
CF
算法
codeforces
C++重新入门-基本输入输出
以下是这些头文件的简要介绍::提供了用于控制台输入输出的基本功能,如std::
cout
、std::cin。包含了标准流对象st
sprite_雪碧
·
2024-02-20 07:14
c++
算法
开发语言
掘根宝典之C++包含对象的类,私有继承,保护继承,三大继承方式总结
一个类里面的类成员之一是个类对象我们来看个例子#includeusingnamespacestd;classAA{private:inta_;public:AA(inta):a_(a){}voidA(){
cout
usingnamespacestd
掘根
·
2024-02-20 07:44
c++
c++
算法
开发语言
《白话C++》第10章 STL和boost,Page84 shared_ptr示例使用,容器中的指针
include#include#include#include//STL的智能指针#includeusingnamespacestd;structBigS{intdata[100];~BigS(){std::
cout
BigSPtr
yanzhenxi
·
2024-02-20 06:25
《白话C++》智能指针专辑
《白话C++》学习
《白话C++》第10章
STL和boost
c++
开发语言
牛客周赛33
利用c/c++的特性自动忽略空格#includeusingnamespacestd;intmain(){stringa,b;cin>>a>>b;
cout
usingnamespacestd;intn,x,
fchampion
·
2024-02-20 06:54
牛客赛事
c++
算法
开发语言
全排列----关于next_permutation()/prev_permutation() 函数的用法
它按照字典序对序列进行重新排序,如果存在下一个排列,则将当前序列更改为下一个排列,并返回true;如果当前序列已经是最后一个排序,则将序列更改为第一个排列,并返回false.vertornums={1,2,3};
cout
nums2
下雪了 ~
·
2024-02-20 05:03
c++
算法
排序——sort的用法
5,1,3,9,11};sort(v.begin(),v.end());//默认升序for(inti=1;iv;}intmain(){ios::sync_with_stdio(0),cin.tie(0),
cout
.tie
下雪了 ~
·
2024-02-20 05:03
c++
开发语言
算法
C++程序设计(一) [cin,
cout
加速,基本数据类型,保留浮点数]
程序基本概念1.常量:执行过程中不可改变的量(constint…)2.变量:执行过程中可以改变的量(inta,longlongb…)3.关键字:不能用作程序中的标识符(变量名不能为关键字)基本数据类型int:整数类型,占用4字节,范围:−231∼231−1≈∣2.1×109∣-2^{31}\sim2^{31}-1\approx\left|2.1\times10^{9}\right|−231∼231
Xeovei
·
2024-02-20 04:09
初级算法
c++
开发语言
算法
UDP服务端demo
#include#includeusingnamespacestd;//导入依赖的库#pragmacomment(lib,"ws2_32.lib")intmain(){
cout
0){//接收数据成功,打印接受的数据
Eula-L
·
2024-02-20 04:05
学习
算法
queue的用法
定义queueq;//定义一个整型队列访问//a.front()-访问队头元素,a.back()-访问队尾元素
cout
#include//调用queue头文件usingnamespacestd;intmain
代码续发
·
2024-02-20 04:00
小白进阶
算法
stack的用法
获得队首元素3.empty():判断是否为空4.size():返回队内元素个数#include#include//引用stack头文件usingnamespacestd;intmain(){stacks;
cout
代码续发
·
2024-02-20 04:00
小白进阶
算法
pair的用法
定义pairp1;//只是定义make_pair("erfds",5);//通过函数初始化pairp2("qwer",4);//定义并初始化访问通过first与second分别访问pair中的元素
cout
代码续发
·
2024-02-20 04:00
小白进阶
算法
c++
数据结构
洛谷 P6546 [COCI2010-2011#2] PUŽ
讲解:首先还是正常输入:inta,b,v;cin>>a>>b>>v;然后经入一个函数num:
cout
<
126wkw2024
·
2024-02-20 02:20
算法
c++
c语言
模拟
数学
C++ 得到map中最后一个元素
mapmapStudent;mapStudent[1]="3";mapStudent[2]="5";mapStudent[3]="1";autoiter1=mapStudent.end();//正确iter1--;
cout
second
白开水。
·
2024-02-20 01:45
c++
94 C++对象模型探索。对象构造语义学 - 继承体系下的对象构造步骤
构造顺序,这里主要是学习方法,有了方法后,在遇见后面复杂的case下可以自己debug//通过反汇编观察classTeacher28grandpa{public:Teacher28grandpa(){
cout
virfunc
hunandede
·
2024-02-20 00:22
c++
开发语言
4.函数模板的局限性
#includeusingnamespacestd;templatevoidCompare(T&a,T&b){if(a==b){
cout
b){
cout
b"#includeusingnamespacestd
Yuga...
·
2024-02-19 23:12
STL学习笔记
c++
算法
开发语言
5.类模板
templateclassPerson{public:Person(NameTypename,AgeTypeage){this->Myname=name;this->Myage=age;}voidShowPerson(){
cout
MynameMyagep1
Yuga...
·
2024-02-19 23:12
STL学习笔记
c++
算法
开发语言
3.普通函数与函数模板的调用规则
如果函数模板可以产生更好的匹配,优先调用函数模板(1).如果函数模板和普通函数都可以实现,优先调用普通函数#includeusingnamespacestd;//普通函数voidPrint(inta,intb){
cout
voidPrint
Yuga...
·
2024-02-19 23:11
STL学习笔记
c++
算法
开发语言
(AtCoder Beginner Contest 341)(A - D)
AtCoderBeginnerContest341)A.Print341模拟就好了,先放一个1,然后放n个01;#include#defineIOSios::sync_with_stdio(0);cin.tie(0);
cout
.tie
ros275229
·
2024-02-19 22:57
atcoder
算法学习
atcoder
算法
c++
23 标签联合
Variant提供了比union更好的类型安全,其行为如下#include"variant.hpp"#include#includeintmain(){Variantv(42);if(v.is())std::
cout
奇点创客
·
2024-02-19 21:23
QT软件实习笔记2
structStudent{intid;charname[41];intage;intscores[3];friendostream&operator>(istream&in,Student&obj){
cout
邶梓鸭~
·
2024-02-19 19:46
qt
笔记
数据库
学习
QT软件实习笔记1
2024.1.13上午1.课堂练习一键盘上输入一个人的年龄,并且输出;用自己习惯的开发环境#includeintmain(){intage;std::
cout
>age;std::
cout
3.变量命名时,
邶梓鸭~
·
2024-02-19 19:15
笔记
qt
软件工程
2024.2.18 C++&&QT 作业
#includeusingnamespacestd;classAnimal{public:virtualvoidperform(){
cout
perform();animal2->perform()
Carl余
·
2024-02-19 19:11
c++
开发语言
C++题目打卡2.18
ans2+=a:ans1+=a);
cout
usi
EthanWYC601
·
2024-02-19 18:43
c++
开发语言
上一页
3
4
5
6
7
8
9
10
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他