摘要:
#include <iostream>using namespace std;int main(){int a=21;cout.setf(ios::showbase);cout<<"dec:"<<a<<endl;cout.unsetf(ios::dec);cout.setf(ios::hex);cout<<"hex:"<<a<<endl;cout.unsetf(ios::hex);cout.setf(ios::oct);cout<<"oct:&quo 阅读全文
摘要:
#include <iostream>using namespace std;class Time{public: Time(){minute=0;sec=0;} Time(int m,int s):minute(m),sec(s){} Time operator++(); Time operator++(int); void display(){cout<<minute<<":"<<sec<<endl;} private: int minute; int sec;};Time Time::operator++() 阅读全文
摘要:
#include <iostream>#include <string>using namespace std;class String{public: String(){p=NULL;} String(char *str); friend bool operator>(String &string1,String &string2); friend bool operator<(String &string1,String &string2); friend bool operator==(String &strin 阅读全文