- 博客(42)
- 收藏
- 关注
原创 c++学习心得
c++课程将要结束了,学习这门语言也已经一学期了,觉得经过一学期的努力后对编程的知识又掌握了不少,程序操作上也有些许熟练与进步。 c++是贺老师给我们上课,贺老师带着我学习,遨游在知识的海洋里。贺老师从一开始上课就向我们介绍了他的上课方式--翻转课堂。这种模式重新调整我们课堂内外的时间,将学习的决定权从教师转移给我学这些学生,我要自主的学习才能够真正的学好,很适合大学生的学习方式。在课堂
2016-06-24 13:09:13
677
原创 c++:简单的动态分配2
#include using namespace std;class fenpei{public: fenpei(int i,int j) { A=i; B=j; cout } fenpei(fenpei &obj) { A=obj.A+100;
2016-06-15 16:45:55
511
原创 c++:深复制
#include #includeusing namespace std;class A{private: char *a;public: A(char *b) { a=new char[strlen(b)+1]; //深复制的重要所在 strcpy(a,b); }
2016-06-15 16:37:04
498
原创 c++:chang fang zhu de tiji yu mianji
#include#includeusing namespace std;class Bulk{ public: void getbulk() { int l,w,h; cout cin>>l>>w>>h; leng
2016-06-14 22:50:14
460
原创 公有继承
#include using namespace std;class point{public: void set(int m,int n) { x=m; y=n; } int getx() { return x; } int gety()
2016-06-14 22:39:54
294
原创 c++:角色类,基础
#include using namespace std;class Role{public: Role(string Name,int Blood) { name=Name; blood=Blood; } void show()
2016-06-13 22:25:33
729
原创 c++:指向学生类的指针:求最高成绩
#include using namespace std;class Student{public: Student(int n,double s) { num=n; score=s; }void out_put(Student stu[],int i){ cout
2016-06-13 22:16:44
2527
原创 c++:人数自定的工资类
#includeusing namespace std;class Salary{public: Salary(int n); Salary(Salary &s); ~Salary(); void get_salary(); void show_salary();private: double *sal
2016-06-13 21:47:50
422
原创 c++:最简单的动态分配
#include using namespace std;class A{public: A() { cout } ~A() { cout }};class B{ A *p;public: B() { cou
2016-06-13 21:14:49
302
原创 c++:有武器的角色类
#include using namespace std;class attack{public: attack(double T) { t=T; } void show() { if(t { cout
2016-06-11 23:47:19
761
原创 c++:友元函数
#include #includeusing namespace std;class Cfriend{public: Cfriend(double xx=0,double yy=0) { x=xx; y=yy; } void getx(double xx); void
2016-06-11 23:25:10
387
原创 c++:角色类
#include #includeusing namespace std;class Role{public: void setRole(string Name,int Blood) { name=Name; blood=Blood; }
2016-06-10 23:09:55
920
原创 c语言:递归求最大公约数
#include using namespace std;int gcd(int x,int y){ if(x%y==0) return y; else return gcd(y,x%y);}int main(){ int a,b,g; cin>>a>>b; g=gcd(a,b);
2016-06-10 22:55:12
4483
原创 c++:复数相加
#include using namespace std;class Complex{public: Complex(double a,double b); Complex(Complex &c); void add(Complex C); ~Complex();private: double x; d
2016-06-09 22:03:42
4003
原创 c++:静态函数成员与静态数据成员
#include using namespace std;class time{public: static void year(int Y); void showtime(); void settime(int H,int M,int S);private: static int year; int h
2016-06-08 22:21:09
351
原创 c++:类的组合秋圆的周长与面积与球的体积
#include #includeusing namespace std;class ball;class circle{public: circle(double r); void perimeter(); void area();private: double raduis;};void circle:
2016-06-08 19:40:13
1046
原创 c++:工资类
#include using namespace std;class Salary{public: void setsalary(); void salary_in(int s); void salary_out(); void showsalary();private: double salary[32];
2016-06-07 22:51:15
988
原创 c++:构造与析构函数基本,银行类
#include using namespace std;class bank{public: bank(); ~bank() { cout } void moneybase(double base); void moneyput(double put); void moneyg
2016-06-06 22:33:56
627
原创 c++:计算长方柱体的体积
#include#includeusing namespace std;class zhuti{public: void diarea(double a,double b) { dichang=a; dikuan=b; cin>>a>>b; double s; s=a*b;
2016-06-05 22:49:44
1765
原创 c++:计算三角形的惆怅与面积
#include#includeusing namespace std;class Triangle{ public: void setABC(double x,double y,double z) { a=x; b=y; c=z;
2016-06-05 22:04:54
1849
原创 c++基础:时钟类
#include using namespace std; class Time{public: void settime(); void showtime(); void add_a_sec() { if(sec==59) { sec=0;
2016-06-02 08:19:54
679
原创 c语言:int与char转换示例
#include #include int main(void){int NUM_INT=65;float NUM_FLOAT=11.11;char CH_CHAR='A'; printf("\n 65 (int) ---> %c (char) ",(char)NUM_INT);printf("\n 11.11 (float) ---> %d
2016-06-01 22:11:47
1230
原创 c++基础:学生成绩
#include using namespace std;class student{public: student (double S,int X,char SEX); ~student();void chengji(double chinese,double math,double english);private:
2016-05-31 22:46:40
569
原创 c++基础:判断闰年
烟大计算机#include using namespace std;class clock{public: clock(int year,int month,int day); void timecx(int q,int w,int e); void timeshow();private:
2016-05-25 22:23:50
2670
原创 c++习题:工资统计
c++习题:职工工资统计#include using namespace std;struct WageList{ char name[10]; double baseWage; double bonus; double total; };int main( ){ W
2016-05-18 21:51:54
1110
原创 c语言:删除多余的空格
#include #include int main(){ void delSpace(char sentence[]); char sentence[1000]; gets(sentence); delSpace(sentence); puts(sentence); return 0;} void
2016-05-08 18:13:36
4739
原创 C语言:双重指针对数组排序;
#include"stdio.h"void sort(int **p,int n){ int temp; int i,j; for (i=0;i for(j=i+1;j if(*p[i]>*p[j]) { temp=*p[i];
2016-04-27 22:09:35
764
原创 判断摩天是该年第几天【数组】;
#include using namespace std;struct ymd{ int year; int month; int day;};int days(struct ymd date){ int a[12]={31,29,31,30,31,30,31,31,30,31,30,31};
2016-04-27 22:07:27
225
原创 递归函数秋x的y次方
烟台大学计算机与控制工程学院154-2张全伟17853535839201558504210#include using namespace std;int p(int x,int y){ int a=1; while (n--) a=a*x; return a;}
2016-04-19 22:37:28
767
原创 确定某年某月某天是该年的第几天
#include using namespace std;struct Date{int year;int month;int day;};int main(){ Date d; cin>>d.year>>d.month>>d.day; int temp; if(d.year%4==0||d.year%400==0&&d.year%1
2016-04-13 22:22:55
508
原创 用类求三角形的周长与面积
#include #includeusing namespace std;class triangle{public: void setABC(double x,double y,double z); double perimeter(); double area();private: double a,b,c;}
2016-04-13 22:19:53
1544
原创 华氏温度转化为摄氏温度
#include using namespace std;double SSD(double c);int main(){ double F; cin>>F; double C; C=SSD(F); cout return 0;}double SSD(double f){
2016-04-06 21:58:10
787
原创 输入成绩查看等级
#include using namespace std;int main(){ int n; cin>>n; if (n>=90&&n cout if (n>=80&&n cout if (n>=70&&n cout if (n>=60&&n
2016-04-04 20:44:51
494
原创 求x的n次方
#include using namespace std;double p(int x,int n){ int a=1; while (n--) a*=x; return a;}int main(){ int m,w; cin>>m>>w; int sun; su
2016-04-04 20:43:32
557
原创 递归函数求斐波那契数列
#include using namespace std;int fib(int n);int main (){ int m; cin>>m; int s; s=fib(m); cout return 0;}int fib(int n){ if (n==
2016-03-30 18:23:24
1379
原创 递归函数求奇数的阶乘 1*3*5.......*n
#include using namespace std;int dk(int n);int main(){ int m; int sum; cin>>m; int i; if (m%2!=0) sum = dk(m); cout return 0;}
2016-03-30 18:18:39
1486
原创 递归函数求n的阶乘
烟大计控学院;计算机154-2201558504210;张全伟;#include using namespace std;int dk(int n);int main(){ int m; cin>>m; int sum; sum = dk(m); cout return 0;}
2016-03-30 18:17:38
992
原创 输出星号,倒三角
#include using namespace std;int main(){ int i,j,m; for(i=1;i { for(j=1;j { cout } for(m=0;m {
2016-03-28 21:42:28
1481
原创 1到a的奇数的和
#include using namespace std;int main(){ int a,i,sum; cin>>a; sum=0; for(i=1;i { if(i%2!=0) sum=sum+i; } cout return 0;}
2016-03-28 21:38:39
382
原创 1到a是倒数和。
#include using namespace std;int main(){ double a,i,sum; cin>>a; sum=0.0; for(i=1;i { sum=sum+1.0/i; } cout return 0;}
2016-03-28 21:35:35
340
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人