C++
文章平均质量分 67
_luojingcong_
不后悔, 不遗憾
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
逆向输出一个数组(头尾交换,a[i]与a[n-i-1]交换,i<=(n-1)/2)
#include#define M 10using std::cout;using std::endl;void inv(int*,int);//函数的声明int main(){ int a[M]={42,543,54,5,65,25,35,634,56,524}; cout<<"The original arry:\n"<<endl; for(int i=原创 2014-11-14 17:52:12 · 1680 阅读 · 0 评论 -
C++ class Date
#include#includeusing namespace std;static int data[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};class Date{ friend int count(const Date &);//有元函数,计算该日期是该年的第几天 friend bool leap_year(int);原创 2014-11-14 10:19:27 · 770 阅读 · 0 评论 -
利用C++多态实现 “小鸡哔哔”的歌词
#includeusing namespace std;int flag=0;char a[]="小鸡哔哔~bi~哟";char b[]="小鸡哔哔哔哔~bi~哟";void fa1() {cout<<a<<endl;}void fa2() {cout<<b<<endl;}void fa() {cout<<a<<endl<<b<<endl;}void fb() {cout<原创 2014-11-18 16:55:43 · 1064 阅读 · 0 评论
分享