比这篇新的文章:
Gaoj.cpp 类实现部分
比这篇旧的文章: main.cpp
作者: xpycc, 点击212次, 评论(0), 收藏者(0)
打分:
所有评论,共0条:( 我也来说两句)
比这篇旧的文章: main.cpp
Gaoj.h 类接口
语言: C++, 标签: 无 2008/08/22发布 3个月前更新作者: xpycc, 点击212次, 评论(0), 收藏者(0)
C++语言: Gaoj.h 类接口
01 #include <algorithm>
02 #include <iostream>
03 using namespace std;
04
05 extern int w,wei; //本来想在mynum里static的,但不知道怎么回事只有这样才可以
06
07 class mynum{
08 friend mynum operator*(const mynum&,const mynum&);
09 friend ostream& operator<<(ostream&,const mynum&);
10 public:
11 mynum(int x=0){ fill(Arr,Arr+27,0); Arr[1]=x; }
12 void operator+=(const mynum&);
13 void operator*=(const mynum& rhs) //为了速度只能不择手段了
14 { *this=(*this)*rhs; }
15 void operator++();
16 private:
17 long Arr[26];
18 };
02 #include <iostream>
03 using namespace std;
04
05 extern int w,wei; //本来想在mynum里static的,但不知道怎么回事只有这样才可以
06
07 class mynum{
08 friend mynum operator*(const mynum&,const mynum&);
09 friend ostream& operator<<(ostream&,const mynum&);
10 public:
11 mynum(int x=0){ fill(Arr,Arr+27,0); Arr[1]=x; }
12 void operator+=(const mynum&);
13 void operator*=(const mynum& rhs) //为了速度只能不择手段了
14 { *this=(*this)*rhs; }
15 void operator++();
16 private:
17 long Arr[26];
18 };
所有评论,共0条:( 我也来说两句)
代码