04 2023 档案
摘要:#include<bits/stdc++.h> using namespace std; class Time { private: int minute; int hour; public: void set(int h, int m) { minute = m; hour = h; } frie
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; class number { int fz, fm; friend number operator+(number &n1,number &n2); public: number(int a=0,int b=1
阅读全文
摘要:2.设计思路 3.程序流程图 4.代码实现 #include<bits/stdc++.h> int main() { float solution(float a, float b, float c, float d); float a, b, c, d, x; printf("ÇëÊäÈë·½³Ì
阅读全文
摘要:二、设计思路、 1.先输出前两个月的兔子数,然后进入循环 2.循环中每过一个月都会有新兔子产生,迭代求出当前月份的兔子数 3.求和输出每个月的兔子总数 三、程序流程图 四、代码实现 #include<stdio.h> using namespace std; int main() { long ra
阅读全文
摘要:class Person { public: virtual void bellRing() {} virtual ~Person(){} }; class Student:public Person { public: void bellRing(){ cout << "I am a studen
阅读全文
摘要:#include<iostream> #include <string> using namespace std; class Vehicle { protected: string NO;//编号 public: Vehicle(string n){ NO = n; } virtual int f
阅读全文
摘要:2.设计思路 ①依次列举出所有0~9的两位相同数字 ②在第一步的前提下依次列举出0~9的两位相同数字 ③将第一第二步中的四个数字组成的数进行开根,判断结果是否为整数后输出结果 3.程序流程图 4、代码实现 #include<bits/stdc++.h> using namespace std; in
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; int main() { int i; double b = 0.0, a = 1000; for(i <= 0; i < 5; i ++){ b = (b + a) / (1 + 12 * 0.063); }
阅读全文
摘要:二、设计思路 1.首先判断指定日期年份是否为闰年 2.然后计算出指定日期到1990年1月1日有多少天 3.三天打鱼两天晒网,一个周期为5天,将算出的天数除以5。 4.根据上一步计算结果的余数判断是打鱼还是晒网 (余数为1,2,3为打鱼,余数为4,5则为晒网) 三、程序流程图 四、代码实现 #incl
阅读全文
摘要:2.设计思路 ①.定义A,B,C ②套入循环,先让A选择一本书 ③在A选完书的前提下让B选择一本书 ④在A和B选完书的前提下让C选择一本书 ⑤将A,B,C分别选择的值输出,代表分别选择的书; #include<bits/stdc++.h> using namespace std; int main(
阅读全文
摘要:二.设计思路 1.初始化cock,hen,chicken; 2.套入循环 ①最外层循环控制cock值小于等于20; ②内层循环控制hen值小于等于33,cock增加; ③内层循环控制chicken小于等于100,hen增加; ④代入cock,hen和chicken的值进行运算,如果价格总和等于100
阅读全文