随笔分类 -  c++代码

摘要:删除指定数字 #include<iostream> #include<deque> using namespace std; int main(){ int n,x; cin>>n; int m[n]; for(int i=0;i<n;i++){ cin>>m[i]; } deque<int> a( 阅读全文
posted @ 2023-12-31 09:36 王ys 阅读(2) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<vector> #include<windows.h> using namespace std; bool b=false; int m,l_m,age,grade; string name; struct Student{ int id; s 阅读全文
posted @ 2023-12-29 19:56 王ys 阅读(15) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<windows.h> using namespace std; HWND hand=NULL; DWORD pid=0; HANDLE hProcess=NULL; DWORD BaseValue=0; DWORD SunshineAddres 阅读全文
posted @ 2023-12-23 09:32 王ys 阅读(37) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include "minecraft.h" using namespace std; int main(int argc, char** argv) { TxMinecraft mc; bool con=mc.ConnectMinecraft("zk.mak 阅读全文
posted @ 2023-12-10 09:24 王ys 阅读(47) 评论(0) 推荐(0) 编辑
摘要:删除指定数字 #include<iostream> #include<vector> using namespace std; int main(){ int n,x; cin>>n; int m[n]; for(int i=0;i<n;i++){ cin>>m[i]; } vector<int> 阅读全文
posted @ 2023-12-09 10:00 王ys 阅读(22) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include <fstream> using namespace std; struct card{ string name; int id; int money; bool build_card(int x_id,string x_name){ name= 阅读全文
posted @ 2023-12-02 10:01 王ys 阅读(28) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main(int argc, char** argv) { string n; int x=0; int n1,n2; getline(cin,n); if(n.find(" ")>=0&&n.find(" " 阅读全文
posted @ 2023-11-17 20:01 王ys 阅读(7) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main(int argc, char** argv) { string n; int x=0; int n1,n2; getline(cin,n); if(n.find(" ")>=0&&n.find(" " 阅读全文
posted @ 2023-11-12 09:40 王ys 阅读(4) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main(int argc, char** argv) { string n; int x=0; int n1,n2; getline(cin,n); if(n.find(" ")>0&&n.find(" ") 阅读全文
posted @ 2023-11-11 10:03 王ys 阅读(7) 评论(0) 推荐(0) 编辑
摘要:地盘划分【例】将一个给定的矩形划分为一个个正方形,其规则是先从矩形中划分出一个尽可能大的正方形,接下来,在剩下的矩形中再划分出一个尽可能大的一个正方形,以此类推。例如,宽*长为3*4的矩形,最少可划分为4个正方形,也就是说。取走一个3*3的正方形后,将问题规模变成3*1,然后变为2*1,最后变为1* 阅读全文
posted @ 2023-11-04 09:36 王ys 阅读(40) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int m(int n){ if(n<=1){ return 1; }else{ return n*m(n-1); } } int main(){ int a; cin>>a; cout<<m(a); return 0 阅读全文
posted @ 2023-11-04 09:34 王ys 阅读(7) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int m(int n){ if(n<=2){ return 1; }else{ return m(n-1)+m(n-2); } } int main(){ int a; cin>>a; cout<<m(a); ret 阅读全文
posted @ 2023-11-04 09:33 王ys 阅读(3) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <fstream> using namespace std; int main(int argc, char** argv) { // char data[100]; // ofstream out; // out.open("lll.txt 阅读全文
posted @ 2023-11-03 20:03 王ys 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int p1(int a){ if(a<=2){ return 1; }else{ return p1(a-1)+p1(a-2); } } int main(){ int n; cin>>n; cout<<p1(n); 阅读全文
posted @ 2023-10-29 09:46 王ys 阅读(5) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int m[5],n,num=0; void p1_2(int tf){ for(int j=0;j<5;j++){ for(int i=0;i<5;i++){ if(tf==1){ if(m[j]<m[i]){ nu 阅读全文
posted @ 2023-10-28 09:30 王ys 阅读(9) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main(){ string str; char t; bool jinwei=true; bool tf; cin>>str>>t; if(str[0]=='0'&&t=='f'){ cout<<str; } 阅读全文
posted @ 2023-10-21 09:10 王ys 阅读(12) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include "minecraft.h" using namespace std; TxMinecraft mc; int x=-73,y=143,z=-254; int main(int argc, char** argv) { bool con=mc. 阅读全文
posted @ 2023-10-20 19:59 王ys 阅读(32) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int max(int a[],int n){ int t; if(n==1){ t=a[1]; }else{ if(max(a,n-1)>a[n]){ t=max(a,n-1); }else{ t=n[a] 阅读全文
posted @ 2023-09-24 09:55 王ys 阅读(52) 评论(0) 推荐(0) 编辑
摘要:1136:密码翻译 时间限制: 1000 ms 内存限制: 65536 KB提交数: 68202 通过数: 29094 【题目描述】 在情报传递过程中,为了防止情报被截获,往往需要对情报用一定的方式加密,简单的加密算法虽然不足以完全避免情报被破译,但仍然能防止情报被轻易的识别。我们给出一种最简的的加 阅读全文
posted @ 2023-09-15 20:30 王ys 阅读(295) 评论(0) 推荐(0) 编辑
摘要:2039:【例5.6】冒泡排序 时间限制: 1000 ms 内存限制: 65536 KB提交数: 51543 通过数: 28200 【题目描述】 编程输入n(1≤n≤20)(1≤n≤20)个小于10001000非负整数,然后自动按从大到小的顺序输出。(冒泡排序) 【输入】 第一行,数的个数n; 第二 阅读全文
posted @ 2023-09-08 20:35 王ys 阅读(220) 评论(0) 推荐(0) 编辑