11 2023 档案

摘要:#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 阅读(6) 评论(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 阅读(4) 评论(0) 推荐(0) 编辑

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