摘要: #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)
摘要: 大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图所示: 现给出两人的交锋记录,请统计双方的胜、平、负次数,并且给出双方分别出什么手势的胜算最大。 输入格式: 输入第 1 行给出正整数 N(≤105),即双方交锋的次数。随后 N 行,每行给出一次交锋的信息,即甲、乙双方同时给出的的手 阅读全文
posted @ 2023-05-15 19:18 a_true 阅读(167) 评论(0) 推荐(0)
摘要: #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)
摘要: #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)
摘要: 给定任一个各位数字不完全相同的 4 位正整数,如果我们先把 4 个数字按非递增排序,再按非递减排序,然后用第 1 个数字减第 2 个数字,将得到一个新的数字。一直重复这样做,我们很快会停在有“数字黑洞”之称的 6174,这个神奇的数字也叫 Kaprekar 常数。 例如,我们从6767开始,将得到 阅读全文
posted @ 2023-05-10 21:32 a_true 阅读(234) 评论(0) 推荐(0)
摘要: 本题要求计算 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)
摘要: #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)
摘要: #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)
摘要: #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)
摘要: #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)