-
个人简介
现在的我,弱的可怕。我也是LV10的人了!
C++栈 基础代码
#include<iostream> #include<bits/stdc++.h> using namespace std; int st[1001]; int TOP=0; void push(int x){ //入栈 ++TOP; st[TOP]=x; } void pop(){ //出栈 --TOP; } bool empty(){ //判断栈是否为空(空=true 不是空=false) return TOP==0; } int top(){ //访问栈顶 return st[TOP]; } int main(){ return 0; }
#include<iostream> #include<bits/stdc++.h> #include<stack> using namespace std; int main(){ stack<int>s; // 栈名.top(); 访问栈顶元素 // 栈名.push(进入元素); 入栈 // 栈名.pop(); 出栈 // 栈名.empty(); 判断栈是否为空(空=true 不是空=false) // 栈名.size(); 元素的个数 return 0; }
C++队列 基础代码
#include<iostream> #include<bits/stdc++.h> using namespace std; int q[1001]; int head=0; int tail=0; void push(int t){ //入队 ++tail; q[tail]=t; } void pop(){ //出队 ++head; } int front(){ //访问队首 return q[head+1]; } int back(){ //访问队尾 return q[tail]; } int size(){ //队列大小(元素的个数) return tail-head; } int empty(){ //判断队列是否为空(空=true 不是空=false) return tail-head==0; } int main(){ return 0; }
#include<iostream> #include<bits/stdc++.h> #include<stack> #include<queue> using namespace std; int main(){ queue<int> s,s1; // 队名.push(加入元素); 入队 // 队名.pop(); 出队 // 队名.empty(); 判断队列是否为空(空=true 不是空=false) // 队名.size(); 元素的个数 // 队名.front(); 访问队首 // 队名.back(); 访问队尾 return 0; }
以C++运行:C字符数组 类型转换
#include<iostream> #include<bits/stdc++.h> using namespace std; int main(){ char b[10]="3.14"; double a=atof(b); //字符串数组char转double //cout<<a+0.1<<endl; char b1[10]="114514"; int c=atoi(b1); //字符串数组char转int //cout<<c-4<<endl; char b2[20]="12345678912345"; long long d=atoll(b2); //字符串数组char转long long //cout<<d+1<<endl; char b3[20]="114514"; char *p; int e=strtoll(b3, &p, 10); //cout<<e; return 0; }
以C++运行:C字符数组 基础操作
#include<iostream> #include<bits/stdc++.h> #include<cstring> using namespace std; int main(){ char a[10]="abc"; char b[10]="123"; strcpy(b, a); //复制 //cout<<b<<endl; strcat(b, a); //拼接 //cout<<b<<endl; //cout<<strcmp(a, b); //比较(a==b返回0 a>b返回1 a<b返回-1) strlen(a); //获取长度 return 0 }
C++字符数组 基础操作
#include<iostream> #include<cstring> using namespace std; int main(){ string s; cin>>s; //不能获取空格 getline(cin, s); //能获取带空格的字符串 s.length(); //获取长度 cout<<s.substr(3, 4); //截取子串 参数1:字串起始位置,参数2:字串的长度 cout<<s.find("12"); //查找字串,输出字串的起始位置 s.clear(); // 清空字符串 return 0; }
其实我是摸鱼人 喵喵喵
图形编辑器https://csacademy.com/app/graph_editor/
摸鱼人的小仓库 http://www.staggeringbeauty.com/ 大虫子 https://www.ak-ioi.com/apps/oi-2048/ 华容道 chrome://dino/ 小恐龙 https://littlealchemy2.com/ 小小炼金师 https://2048game.com/ 数字组 https://dimit.me/Fe26/index_zh_CN.html 死铁 http://www.4399.com/ 4399 https://www.mazegenerator.net/ 迷宫 https://lewan.baidu.com/rankland?idfrom=5056&gameSource=mini&gameType=0 百度游戏 [https://deepmess.com/namerena/]名字竞技场
ev.io 枪战游戏 https://www.crazygames.com/game/air-wars-2 飞机 https://www.crazygames.com/game/kirka-io 枪战 https://www.crazygames.com/game/ev-io
-
最近活动
- 【蓝桥杯stema】202310真题练习 IOI
- 【蓝桥杯stema】202210真题练习 IOI
- 冬季训练赛 IOI
- GESP一级练习题目 作业
- 【CQMC】重庆小码王C++月赛 - 算法组 #1 IOI
- 【CQMC】重庆小码王C++月赛 - 语法组 #1 IOI
- 【蓝桥杯stema】202303真题练习 IOI
- 秋季训练赛1 IOI
- 金牌集训营编程测试-1-20230720 IOI
- 金牌集训营编程测试-1-20230716 IOI
- 暑期集训入营语法编程题目 IOI
- 暑期集训入营笔试题目 OI
- 蓝桥杯真题练习 IOI
- GESP-考试 IOI
- 蓝桥杯C++练习1 IOI
- 电子学会考核一级模拟题-4 IOI
- 电子学会考核一级模拟题-2 IOI
- 电子学会考核一级模拟题-1 IOI
- 等级考试一级练习 作业