![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
ReactSpring
尽力做好自己能做的事情,剩下的就交给时间吧。
展开
-
【重学算法】面试必备/考试必备
算法 线性表 // 创建一个数组 const array = new Array(); // for循环遍历 const len = array.length; for(let i = 0; i < len; i++){ console.log(array[i],i); } // forEach array.forEach((item,index)=>{ console.log(item,idnex) }); // map array.map((item,index)=>原创 2022-04-14 00:05:22 · 848 阅读 · 0 评论 -
各种数据结构的遍历框架
数组遍历框架,典型的线性迭代结构: void traverse(int[] arr) { for (int i = 0; i < arr.length; i++) { // 迭代访问 arr[i] } } 链表遍历框架,兼具迭代和递归结构: /* 基本的单链表节点 */ class ListNode { int val; ListNode next; } void traverse(ListNode head) { for (ListNode原创 2021-02-15 09:46:03 · 274 阅读 · 0 评论 -
HDOJ ACM整学期完成题目(部分)(岭南师范学院)
1001/*In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series of integers n, one integer per line. Output For each case, output SUM(n) in one line, followed by a blank line. You may assume the resul原创 2020-12-25 19:08:00 · 2775 阅读 · 1 评论 -
实现向量for_each遍历
#include<iostream> #include<algorithm> #include<vector> using namespace std; std::vector<int> myvector; void traversal (int i){ std::cout<< " " <<i; } int main(){ int N;//The Number N is the Number of student. int原创 2020-11-24 11:28:14 · 135 阅读 · 0 评论 -
C++ foreach
#include<iostream> using namespace std; int main(){ int array[]={1,2,3,4}; for(int i:array){ cout<<i<<" "; } return 0; }原创 2020-11-24 11:07:04 · 252 阅读 · 0 评论 -
遍历map C++
####遍历map C++ #include <iostream> #include <string> #include <map> using namespace std; map<string,int>Ballon; int main(){ int N; //输入map while((cin >> N)!=0){ getchar(); while(N--){ string str; cin >> st原创 2020-11-22 11:17:26 · 131 阅读 · 0 评论 -
C++ 字符串分割split
vector<string> split(const string& str, const string& delim) { vector<string> res; if("" == str) return res; //先将要切割的字符串从string类型转换为char*类型 char * strs = new char[str.length() + 1] ; //不要忘了 strcpy(strs, str.c_str()); char * d =原创 2020-10-16 22:21:07 · 276 阅读 · 0 评论 -
HDOJ ACM 1002
Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines foll原创 2020-09-26 15:29:10 · 64 阅读 · 0 评论 -
HDOJ_ACM 1040
Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights. Give you some integers, your task is to sort these number asce原创 2020-09-25 14:24:06 · 164 阅读 · 0 评论