会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
atrue
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
20
21
22
23
24
25
26
下一页
2023年5月16日
pta_【CPP0036】利用函数模板解决双倍功能
摘要: #include <iostream>using namespace std; template <typename T>T Double(T num){ return 2.0 * num;} int main(void){ char c='\0'; int i=0; long l=0; scanf
阅读全文
posted @ 2023-05-16 21:06 a_true
阅读(35)
评论(0)
推荐(0)
2023年5月15日
锤子剪刀布
摘要: 大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示: 现给出两人的交锋记录,请统计双方的胜、平、负次数,并且给出双方分别出什么手势的胜算最大。 输入格式: 输入第 1 行给出正整数 N(≤105),即双方交锋的次数。随后 N 行,每行给出一次交锋的信息,即甲、乙双方同时给出的的手
阅读全文
posted @ 2023-05-15 19:18 a_true
阅读(167)
评论(0)
推荐(0)
2023年5月12日
pta_【CPP0029】以圆类Circle及立体图形类Solid为基础设计圆锥类Cone
摘要: #include <iostream>#include<cmath>using namespace std;//点类Pointclass Point{private: double x; double y;public: Point(double xv=0,double yv=0);/*构造函数*/
阅读全文
posted @ 2023-05-12 22:30 a_true
阅读(57)
评论(0)
推荐(0)
2023年5月11日
pta_【CPP0028】以圆类Circle及立体图形类Solid为基础设计圆柱类Cylinder
摘要: #include <iostream>using namespace std;//点类Pointclass Point{private: double x; double y;public: Point(double xv=0,double yv=0);/*构造函数*/ Point(const Po
阅读全文
posted @ 2023-05-11 21:41 a_true
阅读(44)
评论(0)
推荐(0)
2023年5月10日
数字黑洞
摘要: 给定任一个各位数字不完全相同的 4 位正整数,如果我们先把 4 个数字按非递增排序,再按非递减排序,然后用第 1 个数字减第 2 个数字,将得到一个新的数字。一直重复这样做,我们很快会停在有“数字黑洞”之称的 6174,这个神奇的数字也叫 Kaprekar 常数。 例如,我们从6767开始,将得到
阅读全文
posted @ 2023-05-10 21:32 a_true
阅读(234)
评论(0)
推荐(0)
2023年5月9日
A除以B(千位数除法)
摘要: 本题要求计算 A/B,其中 A 是不超过 1000 位的正整数,B 是 1 位正整数。你需要输出商数 Q 和余数 R,使得 A=B×Q+R 成立。 输入格式: 输入在一行中依次给出 A 和 B,中间以 1 空格分隔。 输出格式: 在一行中依次输出 Q 和 R,中间以 1 空格分隔。 #include
阅读全文
posted @ 2023-05-09 13:54 a_true
阅读(323)
评论(0)
推荐(0)
2023年5月8日
pta_【CPP0027】以圆类Circle及立体图形类Solid为基础设计球类Sphere
摘要: #include <iostream>using namespace std;//点类Pointclass Point{private: double x; double y;public: Point(double xv=0,double yv=0);/*构造函数*/ Point(const Po
阅读全文
posted @ 2023-05-08 18:51 a_true
阅读(103)
评论(0)
推荐(0)
2023年5月5日
pta_【CPP0026】以点类Point及平面图形类Plane为基础设计三角形类Triangle
摘要: #include <iostream>#include<cmath>using namespace std;//点类Pointclass Point{private: double x; double y;public: Point(double xv=0,double yv=0);/*构造函数*/
阅读全文
posted @ 2023-05-05 19:43 a_true
阅读(68)
评论(0)
推荐(0)
2023年5月4日
pta_【CPP0024】设计并实现大数类BigNum
摘要: #include <iostream>using namespace std;#define N 100 #include<cstring> class BigNum{private: char num[N];public: BigNum(char c[N] = "+0") { int i,j,a
阅读全文
posted @ 2023-05-04 21:08 a_true
阅读(120)
评论(0)
推荐(0)
2023年4月27日
pta__【CPP0025】以点类Point及平面图形类Plane为基础设计圆类Circle
摘要: #include <iostream>using namespace std;//点类Pointclass Point{private: double x; double y;public: Point(double xv=0,double yv=0);/*构造函数*/ Point(const Po
阅读全文
posted @ 2023-04-27 20:23 a_true
阅读(82)
评论(0)
推荐(0)
上一页
1
···
20
21
22
23
24
25
26
下一页
公告