自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Jetty配置jaas访问权限以及密码

jetty 权限控制jaaslogin-config服务器

2016-04-21 16:14:55 3757

原创 Android新手关于unfortunaly,xxx has stoped!的解决问题

当我创建第一个Android应用的时候,发现有安装上AVD的程序,一点开弹出unfortunalu,xxx has stoped!的警告,我开始的时候检查了我的代码,没发现有什么错误,所以我应为出错的原因是AVD的内存分配不够,但加大了内存,程序还是不能运行。所以我检查了我的代发现问题是出在setContentView(R.layout.activity_main),原来是我填充的页面不对,所以我

2015-03-19 00:02:03 2045

原创 定义一个泛型静态方法,用于输出两个指定集合Collection集合的并、交和差集并验证

import java.util.*;public class TestSetOperation {public static void setOperation(Collection collection1,Collection collection2){Collection unionSet=new HashSet();Collection intersectionSet=n

2014-11-12 21:56:19 1117

原创 java求两个字符串最长公共字符串

public class SimilarString {public static String compareS(String str1,String str2){String str="";if(str1=="" || str2=="")return "";if(str1==str2){str=str1;return str;}   for(int i=

2014-11-12 21:43:25 713

原创 编写一个类,该类具有统计文件长度,实现文件复制的函数。   其中复制功能函数如:   void copy(string srcFileName,string targetFileName);

#include#includeusing namespace std;class copystrlen{public:void copy(string srcFileName,string targetFileName);private:char ch;}; void copystrlen::copy(string srcFileName,string t

2013-12-08 18:29:45 966

原创 对数组进行排序、求最大值和求元素和的算法都编写为函数模板,采用相关数据进行测试。

#includeusing namespace std;templateT Max(T elem[],int size){   T max=elem[0];for(int i=1;i{if(maxmax=elem[i];}return max;} template T Sum(T elem[],int size){      T su

2013-12-08 18:28:34 1677

原创 6.对数组进行排序、求最大值和求元素和的函数采用静态成员函数的方式封装成数组算法类模板ArrayAlg,并采用相关数据进行测试。

#includeusing namespace std;templateclass ArrayAlg{private:T *elem;int size;public:ArrayAlg(int a[],int s):elem(a),size(s){}static T Max(T elem[],int size);static T Sum(T elem[],in

2013-12-08 18:27:07 3248 3

原创 编写一个使用数组类模板Array对数组进行排序、求最大值和求元素和的程序,并采用相关数据进行测试。

#includeusing namespace std;templateclass Array{private:T *elem;int size;public:Array(int a[],int s):elem(a),size(s){}T Max();T Sum();void Sort();void Display();}; templa

2013-12-08 18:25:40 9467 2

原创 用抽象类设计计算二维图形面积的程序,在基类TDshape中设计纯虚函数area()和printName().are()用于计算图形的几何面积,printName()用于打印输出几何图形的类名

#includeusing namespace std;class TDshape{protected:double Width,Heigth;public:void set(double a,double b) {Width=a;Heigth=b;};virtual double area()=0;virtual void printName()=0;};

2013-12-02 23:51:23 3007 1

原创 设计一个计算器类Calculator,它只有一个计数的成员count。该计算器的有效范围说0~65535,实现计算器的前自增、后自增、前自减、后自减、两个计算器相加减等运算

#includeusing std::cout;using std::endl; class Calculator{  private:      double count;  public:      Calculator(double a):count(a){};      double getcount(){          return count;

2013-12-02 23:44:12 5706

原创 设计一个时间类Time,要求: (1)包含时(hour)、分(minute)和秒(second)私有数据成员。 (2)包含构造函数,重载关于一时间加上另一时间的加法运算符+、重载关于一时间减去另一时间

#includeusing namespace std;class Time{private:int hour;int minute;int second;public:Time();Time(int h, int m ,int s);Time operator+(Time &t);Time operator-(Time &t);Time ope

2013-12-02 23:38:27 44272 5

原创 设计一个日期类Date,,要求: (1)包含年(year)、月(month)和日(day)私有数据成员。 (2)包含构造函数,重载关于一日期加上天数的加法运算符+、重载关于一日期减去天数的减加运算符-

#includeusing namespace std;class Date{private:int year,month,day;public:Date(int y=1,int m=1 ,int d=1){year=y;month=m;day=d;}int GetYear() const {return year;}int GetMonth() c

2013-12-02 23:37:26 29469 3

原创 定义一个描述学生(Student)基本情况的类,数据成员包括姓名(name)、学号(num)、数学成绩(mathScore)、英语成绩(englishScore)、人数(count)、数学总成绩(ma

#includeusing namespace std;class Student{char *name;int number;int mathScore;int englishScore;static int num;static int mathTotalScore;static int englishTotalScore;public:Studen

2013-12-02 23:35:53 14489

原创 编写设计一个People(人)类。该类的数据成员有年龄(age)、身高(height)、体重(weight)和人数(num),其中人数为静态数据成员,成员函数有构造函数(People)、进食(Eatt

#includeusing namespace std;class People{protected:int age;double height;double weight;static int num;public:People(int a ,double h,double w){age=a;height=h;weight=w;num++;}

2013-12-02 23:34:48 4482

原创 某单位的职工工资包括基本工资Wage,岗位津贴Subsidy,房租Rent,水费WaterFee,电费ElecFee。设计实验工资单位管理的类Salary

#include#includeclass Salary{private: double Wage;   double Subsidy;   double Rent;    double Waterfee;   double Elecfee;  public:   Salary(double wage=0,double subsidy=0,d

2013-11-15 21:19:19 7306 4

原创 编写重载函数min(),分别计算int、double、float、long类型数组中的最小树

#includeusing namespace std;#define n 5int min(int a[n]){  int min;  min=a[0]; for(int i=1;i {  if(min>a[i])    min=a[i]; } return min;}float min(float a[n]){ float min=a

2013-11-14 19:28:16 6083

空空如也

空空如也

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

TA关注的人

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