摘要: 实例简单的输入今天的代码#include<iostream>using namespace std;enum week{ sun, mon, tue, wed, thu, fri, sat, };int main() {week yesterday,tomorrow,today,day;int code;cout<<"0 sun,1 mon,2 tue,3 wed,4 thu,5 fri,6 sat"<<endl;cout<<"请输入今天的代码:"<<endl; cin>>code; 阅读全文
posted @ 2012-08-25 22:49 Alan Perlis 阅读(146) 评论(0) 推荐(0)
摘要: 重载运算符#include<iostream.h>//using namespace std;class point{public:int x,y;public:point() {x=0;y=0;}point(int xx,int yy) {x=xx;y=yy;}friend ostream &operator<<(ostream &output,point obj);friend istream &operator>>(istream &input,point &obj);};ostream &operato 阅读全文
posted @ 2012-08-25 22:44 Alan Perlis 阅读(236) 评论(0) 推荐(0)