本文讲解 C++ 中循环的使用。
C++ 中较常用的两种循环为 for 循环和 while 循环。
for 循环for 循环主要用于实现两个区间中间的枚举。
例如:从 中输出所有数就能使用 for 循环解决。
这是 for 循环标准格式:
1234...
本篇帖子学习 C++ 输入输出。
C++ 目前最常用的两种输入输出方法,cin/cout 和 scanf/printf。
cin/cout这是 C++ 入门必学且最最最基础的输入输出方式,在 <iostream> 头文件,std...
这是什么?要先学习 C++,我们要先了解 C++ 是什么
这是 Wiki Pedia 的解释,我们来提炼一下:
C++ 是一种高级语言。
C++ 是 C 语言的扩展升级版。
C++ 是面向对象语言。
下载环境简单了解一下后,我们来下载 C++ ...
题解思路:双向链表+组合数学(不过你要用单调栈也没人拦着你)
我们现在先抛开题面,先换个思路。
我们现在求:这个数能做多少个区间的次大值。
我们现在设 分别为左边第一个比这个数大的 id,第二个比这个数大的 id,右边第一个比这个数大的 id,第二...
以此记录初入洛谷的自己写的题解,虽然没通过。
算法概述本题需使用 map 和数论知识。
题意讲解设 是这些数的最大公约数, 是这些数的最小公倍数;求一组数据中的 是否等于 。
暴力做法(44分)这题大家最容易想到的方法就是将 以及 都算出...