随笔分类 -  c++代码

摘要:#include<bits/stdc++.h> #include<windows.h> using namespace std; int main() { MessageBox(NULL,"你好,这是一个提示信息框","信息框",MB_OK); MessageBox(NULL,"你好,这是一个提示信 阅读全文
posted @ 2024-05-04 09:16 王ys 阅读(14) 评论(0) 推荐(0) 编辑
摘要:冒泡排序 #include<iostream> using namespace std; int main(){ int m[]={6,8,44,7,9,34,64,1}; for(int j=0;j<8;j++){ for(int i=j+1;i<8;i++){ if(m[j]>m[i]){ sw 阅读全文
posted @ 2024-04-20 14:42 王ys 阅读(16) 评论(0) 推荐(0) 编辑
摘要:2059:【例3.11】买笔 时间限制: 1000 ms 内存限制: 65536 KB提交数:61425 通过数: 33243 【题目描述】 期末来临了,班长小Q决定将剩余班费<span id="MathJax-Span-2" class="mrow"><span id="MathJax-Span- 阅读全文
posted @ 2024-04-13 15:10 王ys 阅读(117) 评论(0) 推荐(0) 编辑
摘要:单人 #include<iostream> #include<windows.h> #include<conio.h>//控制台输入输出头文件 using namespace std; int main(){ HANDLE handle=GetStdHandle(STD_OUTPUT_HANDLE) 阅读全文
posted @ 2024-04-13 15:09 王ys 阅读(25) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<cmath> using namespace std; int main(){ int i=0; string m; cin>>m; freopen("in.txt","w",stdout); cout<<m; freopen("in.txt" 阅读全文
posted @ 2024-03-30 09:57 王ys 阅读(13) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<cmath> using namespace std; int main(){ float x,n,b=0; cin>>x>>n; b=sqrt(1+x); for(int i=2;i<=n;i++){ b=sqrt(i+b); } cout< 阅读全文
posted @ 2024-03-30 08:59 王ys 阅读(36) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> #include <fstream> #include<map> using namespace std; struct book{ string name; int money; string cbs; string type; int id; } 阅读全文
posted @ 2024-03-16 10:01 王ys 阅读(16) 评论(0) 推荐(0) 编辑
摘要:三角 #include<iostream> using namespace std; int main(){ int i,j,k; char ch; for(i=1;i<=10;i++){ ch='A'; for(j=1;j<=10-i;++j){ cout<<" "; } for(k=1;k<=2 阅读全文
posted @ 2024-03-15 20:11 王ys 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include "minecraft.h" using namespace std; TxMinecraft mc; int main(int argc, char** argv) { bool con=mc.ConnectMinecraft("zk.mak 阅读全文
posted @ 2024-03-08 19:51 王ys 阅读(10) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include "minecraft.h" using namespace std; TxMinecraft mc; int x=6,y=75,z=-50; void z1(int z){ mc.setBlock(x+1,y,z,143,11); mc.se 阅读全文
posted @ 2024-03-01 19:58 王ys 阅读(11) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<stack> using namespace std; int main(){ string a; cin>>a; stack<char> m; for(int i=0;i<a.length();i++){ if(a[i]=='('||a[i] 阅读全文
posted @ 2024-02-19 11:31 王ys 阅读(6) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include "minecraft.h" #include <string> using namespace std; TxMinecraft mc; int x=0,y=0,z=0; int main(int argc, char** argv) { b 阅读全文
posted @ 2024-02-18 11:46 王ys 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<queue> using namespace std; int main(){ int n,m; cin>>n>>m; queue<int> a; for(int i=1;i<=n;i++){ a.push(i); } while(!a.emp 阅读全文
posted @ 2024-01-31 11:28 王ys 阅读(34) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<queue> using namespace std; int main(){ int m,w,x; cin>>m>>w; queue<int> a; queue<int> b; cin>>x; for(int i=1;i<=m;i++){ a 阅读全文
posted @ 2024-01-31 10:41 王ys 阅读(7) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; int main(){ int n,m,a[n]; bool o=false; cin>>n; int l=n+1; for(int i=0;i<n;i++){ cin>>a[i]; } for(int j=0;j<n; 阅读全文
posted @ 2024-01-29 11:39 王ys 阅读(59) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<set> using namespace std; int main(){ int m,n,x=0,c[1000],p=-1; set<int> a; cin>>m>>n; int b; set<int>::iterator i; for(in 阅读全文
posted @ 2024-01-29 10:52 王ys 阅读(47) 评论(0) 推荐(0) 编辑
摘要:桶排序 #include<iostream> using namespace std; int main(){ int value; int a,max=100000; int list[max]={0}; cin>>a; for(int i=0;i<a;i++){ cin>>value; list 阅读全文
posted @ 2024-01-28 11:15 王ys 阅读(10) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> using namespace std; class Box{ private: double length; double width; public: void setLength(double length); void setWidth(double w 阅读全文
posted @ 2024-01-27 09:09 王ys 阅读(3) 评论(0) 推荐(0) 编辑
摘要:1. #include<iostream> #include<list> using namespace std; int main(){ list<int> a={1,2,3,4,5}; list<int> b={6,7,8,9,10}; list<int>::iterator i; a.spli 阅读全文
posted @ 2024-01-05 19:45 王ys 阅读(8) 评论(0) 推荐(0) 编辑
摘要:#include<iostream> #include<list> #include<algorithm> using namespace std; int main(){ list<int> a; int b[]={1,2,3,4}; list<int> c(b,b+sizeof(b)/sizeo 阅读全文
posted @ 2023-12-31 10:00 王ys 阅读(4) 评论(0) 推荐(0) 编辑