自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(24)
  • 收藏
  • 关注

原创 敲代码的第二十三天:模板与异常——分数类(版本一完整)(c++)

#include<iostream>#include<string.h>using namespace std;class denominator_zero {};template<class T>class score {private: T molecular; T denominator;...

2021-11-18 23:24:09 129

原创 敲代码的第二十三天:模板与异常——分数类(版本一完整)(c++)

#include<iostream>#include<string.h>using namespace std;class denominator_zero {};template<class T>class score {private: T molecular; T denominator;...

2021-11-18 23:23:02 139

原创 敲代码的第二十三天:模板分数上篇(c++)

#include<iostream>#include<string.h>using namespace std;class denominator_zero {};template<class T>class score {private: T molecular; T denominator;public: score() {} score(T x, T y); score add(score x); sco...

2021-11-17 23:32:36 444

原创 敲代码的第二十二天:创建简单学生类(c++)

#include<iostream>#include<fstream>#include<string>#include<vector>using namespace std;class Student { string name; float score;public: Student() {} Student(string n, float sc) { name = n; score...

2021-11-15 23:06:27 795

原创 敲代码的第二十一天:推箱子c++(java)

package com.wangwang2;import javax.swing.*;import java.awt.*;import java.awt.event.KeyEvent;import java.awt.event.KeyListener;public class GameFrame extends JFrame { private JPanel panel = null; private JLabel box = null; private JLabel.

2021-11-11 23:21:19 51

原创 敲代码的第二十天:职员信息类(c++)

#include<iostream>using namespace std;class Employee {protected: char Name[30]; char Num[5]; int Work_Age; double Total_Salary;public: virtual void Get_Message(); virtual void Pay() = 0 ; void Show_Message();};class...

2021-11-10 23:42:09 716

原创 敲代码的第十九天:利用继承和多态求正方体,圆柱体,球体的面积和体积(c++)

#include<iostream>using namespace std;class basic {public: virtual double superficial_area() = 0; virtual double volume() = 0; ~basic() {}};class cube :public basic{private: double length;public: cube(double a) :len...

2021-11-08 19:50:25 896 2

原创 敲代码的第十八天:推箱子2.0(java)

package com.wangwang2;import javax.swing.*;import java.awt.*;import java.awt.event.KeyEvent;import java.awt.event.KeyListener;public class GameFrame extends JFrame { private JPanel panel = null; private JLabel box = null; private JLabel.

2021-11-07 20:26:07 69

原创 敲代码的第十七天:账户类第三版下完整版(c++)

#include<iostream>#include<string>using namespace std;class Bank {protected: const string id; string password; double balance;public: Bank(const string Id, string Password, double Balance) :id(Id) { password = Pass...

2021-10-30 23:10:19 64

原创 敲代码的第十六天:创建子类账户第三版(上)(c++)

#include<iostream>using namespace std;class Bank {protected: const string id; string password; double balance;public: Bank(const string Id, string Password, double Balance) :id(Id) { password = Password; balance = ...

2021-10-28 23:52:50 90

原创 敲代码的第十五天:复数的运算(类和对象)(c++)

#include<iostream>using namespace std;class Complex {private: double real, imag;public: Complex(double r = 0.0, double i = 0.0) { real = r; imag = i; } Complex operator +(Complex c); Complex operator -(Compl...

2021-10-27 21:45:57 68

原创 敲代码的第十四天:完整推箱子第一版第二遍(java)

package niansong1;import javax.swing.*;import java.awt.*;import java.awt.event.KeyEvent;import java.awt.event.KeyListener;import java.awt.font.ImageGraphicAttribute;public class TXZ { public static void main(String[] args){ JFrame gameF.

2021-10-24 18:03:38 1467

原创 敲代码的第十三天:引用基础(c++)

#include<iostream>using namespace std;//返回局部变量引用int& test01(){ int a=10; return a;}int& test02(){ static int a = 20; return a;}int main(){ //不能返回局部变量的引用 int &ref = test01(); cout<<"ref = "<&l...

2021-10-23 21:43:21 38

原创 敲代码的第十二天:推箱子基础完整版(java)

package com.wangwang1;import javax.swing.*;import java.awt.*;import java.awt.event.KeyEvent;import java.awt.event.KeyListener;public class TXZ1 { public static void main(String[] args) { //类名 对象名; JFrame gameFrame = new JFrame();.

2021-10-22 23:18:25 97

原创 敲代码的第十一天:推箱子练习(设置窗口,添加围墙及图片)(java)

package wangwang2;import javax.swing.*;import java.awt.*;import java.awt.font.ImageGraphicAttribute;public class TXZ2 { public static void main(String[] args){ JFrame gameFrame = new JFrame(); gameFrame.setTitle("推箱子"); ga.

2021-10-21 23:16:02 85

原创 敲代码的第十天:储蓄账户版本二(c++)

#include<iostream>#include<string>using namespace std;class BaseAccount{public: static long money; const long num;public: BaseAccount():num(888666) { cout<<"请输入六位银行账户:"; long num1; while(1) {cin>...

2021-10-20 23:24:06 86

原创 敲代码的第九天:推箱子----使人物移动(java)

接前篇for (int i = 1; i <= 10; i++) { panel.add(walls[index]); walls[index++].setBounds(0, i * 48, 48, 48); panel.add(walls[index]); walls[index++].setBounds(21 * 48, i * 48, 48, 48); } //添.

2021-10-19 22:06:40 229

原创 敲代码的第八天:构建储蓄账户类,用到继承性(c++)

#include <iostream>#include <string.h>using namespace std;class Account {private: int id; char name[20]; //字符数组 int money;public: Account(); Account(int id); Account(int id, char name[], int money); void in.

2021-10-18 22:15:35 164

原创 敲代码的第六天:推箱子第一部分(java.)

package niansong1;import javax.swing.;import java.awt.;public class TXZ {public static void main(String[] args){JFrame gameFrame = new JFrame();gameFrame.setTitle(“推箱子1.0”);//设置标题gameFrame.setSize(2248+10,1248+38);//设置大小//gameFrame.setLocation((192

2021-10-14 21:45:48 52

原创 敲代码的第五天:不知名(c++)

#include<iostream>#include<cmath>using namespace std;int find(n){ int count = 0; long num=0,x = 0, y = 0; while(1){ num++; x = sqrt(num+100); y = sqrt(num+268); if(x*x==num+100&&y*y==num+26...

2021-10-13 21:53:58 37

原创 敲代码的第四天:计算二维平面图形面积(c++)

代码:#include <iostream>/* run this program using the console pauser or add your own getch, system("pause") or input loop */using namespace std;class TDshape{public: virtual void area() = 0; virtual void printName() = 0;};class Trian...

2021-10-12 20:56:16 208

原创 敲代码的第三天:创建时间类实现功能(c++)

题目要求:再加两个功能:正数计时和倒数计时#include<iostream>#include<windows.h>using namespace std;class Time {public:int hour;int minute;int sec;Time() {int hour=0;minute = 0;sec = 0;}Time(int h,int m, int s):hour(h),minute(m), s.

2021-10-11 22:16:07 209

原创 敲代码的第二天:构造函数特点及实例(c++)

1.构造函数的作用:由于类是一个抽象概念,不是实体,所以不可以在声明时对数据成员进行初始化,此时即需要构造函数来为对象的属性赋初值。2.构造函数的定义格式:类名(形参){ ...........};3.构造函数的特点(与普通方法的区别): a.方法名与类名相同:类名,构造方法名首字母大写,而普通方法中为小写; b.无返回值,也不用加void; c.构造函数对象创建时系统自动调用,而普通方法需要对象名.方法名调用。4....

2021-10-10 13:15:50 171

原创 敲代码的第一天:创建函数并调用求长方形面积(c++)

1.Rectangle.h#include<iostream>using namespace std;class Rectangle {private: int height; int width;public: Rectangle(); Rectangle(int height, int width); int getPerimeter(); int getPArea(); void print();};2.Rect

2021-09-26 21:31:40 1589

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除