随笔分类 -  c++代码

摘要:1309:【例1.6】回文数(Noip1999) 时间限制: 1000 ms 内存限制: 65536 KB提交数: 24068 通过数: 10153 【题目描述】 若一个数(首位不为零)从左向右读与从右向左读都是一样,我们就将其称之为回文数。例如:给定一个 10进制数 56,将 56加 65(即把5 阅读全文
posted @ 2023-09-08 20:08 王ys 阅读(354) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; void show(int a,int b){ if(b<=9){ if(a<=b){ cout<<a<<"x"<<b<<"="<<a*b<<" "; show(a+1,b); } cout<<endl; } show 阅读全文
posted @ 2023-09-03 08:52 王ys 阅读(8) 评论(0) 推荐(0) 编辑
摘要:2066:【例2.3】买图书 时间限制: 1000 ms 内存限制: 65536 KB提交数: 87778 通过数: 51324 【题目描述】 已知小明有n元,他买了一本书,这本书原价为m元,现在打8折出售。求小明还剩多少钱(保留2位小数)。 【输入】 输入n,m。 【输出】 小明还剩多少钱(保留2 阅读全文
posted @ 2023-08-24 17:54 王ys 阅读(143) 评论(0) 推荐(0) 编辑
摘要:2065:【例2.2】整数的和 时间限制: 1000 ms 内存限制: 65536 KB提交数: 69280 通过数: 58746 【题目描述】 求3个整数的和。 输入a、b、c这3个整数,求它们的和。 【输入】 3个整数。 【输出】 三个数的和。 【输入样例】 1 2 3 【输出样例】 6 #in 阅读全文
posted @ 2023-08-24 17:53 王ys 阅读(50) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <iomanip> int h=16; int l=16; bool is_black=true; int all_list[16][16]; bool black_list[16][16]; bool while_list[16][16]; 阅读全文
posted @ 2023-08-10 20:35 王ys 阅读(30) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> #include <Windows.h> using namespace std; int main(int argc, char** argv) { 阅读全文
posted @ 2023-08-08 20:25 王ys 阅读(23) 评论(0) 推荐(0) 编辑
摘要:1312:【例3.4】昆虫繁殖 时间限制: 1000 ms 内存限制: 65536 KB提交数: 41168 通过数: 20495 【题目描述】 科学家在热带森林中发现了一种特殊的昆虫,这种昆虫的繁殖能力很强。每对成虫过x�个月产y�对卵,每对卵要过两个月长成成虫。假设每个成虫不死,第一个月只有一对 阅读全文
posted @ 2023-08-03 20:04 王ys 阅读(49) 评论(0) 推荐(0) 编辑
摘要:1848:【07NOIP提高组】字符串的展开 时间限制: 1000 ms 内存限制: 65536 KB提交数: 1091 通过数: 481 【题目描述】 在初赛普及组的“阅读程序写结果”的问题中,我们曾给出一个字符串展开的例子:如果在输入的字符串中,含有类似于“D-H”或“4-8”的字串,我们就把它 阅读全文
posted @ 2023-07-24 19:58 王ys 阅读(58) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main(int argc, char** argv) { int n,m,x=0; cin>>n; char a[100][100]; int b[100][100]; for(int j=1;j<=n;j+ 阅读全文
posted @ 2023-07-08 20:09 王ys 阅读(7) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include "minecraft.h" #include <string> using namespace std; TxMinecraft mc; int x,y,z; bool con; bool lianjie(){ return con=mc.C 阅读全文
posted @ 2023-07-08 08:43 王ys 阅读(7) 评论(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 @ 2023-07-07 20:30 王ys 阅读(13) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main(int argc, char** argv) { int n; cin>>n; int l[1000],r[1000],h[1000]; for(int i=1;i<=n;i++){ cin>>h[i 阅读全文
posted @ 2023-07-01 18:24 王ys 阅读(21) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include "minecraft.h" #include <string> TxMinecraft mc; using namespace std; struct c{ int x; int y; int z; int id; int data; int 阅读全文
posted @ 2023-06-25 10:01 王ys 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> using namespace std; int main(int argc, char** argv) { int n,l; cin>>n>>l; int m[n]; int Max=0,Min=0; for(int i=0;i<n;i++){ cin>>m 阅读全文
posted @ 2023-06-24 18:44 王ys 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <map> #include <bits/stdc++.h> using namespace std; map<string,int>name_mon; int main(int argc, char** argv) { string nam 阅读全文
posted @ 2023-06-23 19:58 王ys 阅读(19) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <cmath> using namespace std; int main(int argc, char** argv) { string a; int max=100,min=0; while(a!="对了"){ cout<<"猜是"<<( 阅读全文
posted @ 2023-06-07 18:21 王ys 阅读(49) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main(int argc, char** argv) { int a[10]; int m; srand(time(0)); for(i 阅读全文
posted @ 2023-06-07 17:02 王ys 阅读(16) 评论(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 @ 2023-05-28 08:53 王ys 阅读(12) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include "minecraft.h" using namespace std; TxMinecraft mc; int x=0,y=00,z=0; int main(int argc, char** argv) { bool con=mc.Connec 阅读全文
posted @ 2023-05-27 20:03 王ys 阅读(16) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main(int argc, char** argv) { int shuliang,n1,n2,x,s,m=0; cout<<"输入你要 阅读全文
posted @ 2023-05-13 19:18 王ys 阅读(16) 评论(0) 推荐(0) 编辑