随笔分类 -  C++

摘要:1.三角形 #include <iostream> using namespace std; int main() { int t; cin>>t; int n = 65; for(int i = 1;i<=t;i++){ for(int j = 1;j<=t-i;j++){ cout<<" "; 阅读全文
posted @ 2024-03-15 20:02 王一行(小号) 阅读(20) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; string no1(string);//清除多余空格 int no2(string,string);//计算 int no3(string,string);//寻找乘除的上一个运算符号在第几位 int no 阅读全文
posted @ 2023-11-11 10:03 王一行(小号) 阅读(12) 评论(0) 推荐(0) 编辑
摘要:5.话题焦点人物 #include <bits/stdc++.h> using namespace std; map<int,int>x; int main(){ int n,maxx = 0,z; cin>>n; int a[n+1],b[n+1],k[n+1][21]; for(int i = 阅读全文
posted @ 2023-11-08 19:29 王一行(小号) 阅读(40) 评论(0) 推荐(0) 编辑
摘要:斐波那契数列 #include <iostream> using namespace std; int main(){ int n; cin>>n; int f[100]; f[1] = 1;f[2] = 1; for(int i = 3;i<=n;i++){ f[i] = f[i-1]+f[i-2 阅读全文
posted @ 2023-11-04 09:51 王一行(小号) 阅读(12) 评论(0) 推荐(0) 编辑
摘要:斐波那契数列(1) #include <iostream> using namespace std; int x(int n){ if(n<=2){ return 1; }else{ return x(n-1)+x(n-2); } } int main(){ int n; cin>>n; int a 阅读全文
posted @ 2023-10-29 09:48 王一行(小号) 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-10-29 09:27 王一行(小号) 阅读(4) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int ROW = 16,COL = 16; bool a = true,player1[16][16],player2[16][16],a1; int Player[16][16] = {0}; void 阅读全文
posted @ 2023-08-10 20:35 王一行(小号) 阅读(12) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int maxH = 16,maxL = 16,l = maxH/2,h = maxL/2; int main(){ srand(time(0)); int h1[3],l1[3]; for(int i = 阅读全文
posted @ 2023-08-08 20:33 王一行(小号) 阅读(39) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int main() { int a,b,qian = 50; while(qian>0){ srand(time(0)); b = rand()%9+1; cout<<"请输入你选的号码?"; cin>>a 阅读全文
posted @ 2023-05-13 19:41 王一行(小号) 阅读(31) 评论(0) 推荐(0) 编辑
摘要:#include <bits/stdc++.h> using namespace std; int main() { int a,b,e; double c,d = 0; double f; cout<<"你想做几道题?"; cin>>c; for(int i = 1;i<=c;i++){ sran 阅读全文
posted @ 2023-05-13 19:23 王一行(小号) 阅读(15) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示