- #ifndef iostream
- #define iostream
-
- #include <cstdio>
- #include <typeinfo>
-
- namespace mystd{
-
- class CEndl{};
- class CHex{};
-
- class CCout{
- private:
- bool hex;
- public:
- CCout(){
- hex=false;
- }
- ~CCout(){
-
- }
-
- template <class T> CCout& operator << (T t){
- if(typeid(int) == typeid(t)){
- if(hex == true){
- printf("%X ", t);
- hex = false;
- }else
- printf("%d ", t);
- }else if(typeid(double) == typeid(t)){
- printf("%f ", t);
- }else if(typeid(float) == typeid(t)){
- printf("%f ", t);
- }else if(typeid(char *) == typeid(t)){
- printf("%s ", t);
- }else if(typeid(char) == typeid(t)){
- printf("%c ", t);
- }else if(typeid(CEndl) == typeid(t)){
- printf("\r\n", t);
- }else if(typeid(CHex) == typeid(t)){
- hex = true;
- }
- return *this;
- }
- };
-
- CCout cout;
- CEndl endl;
- CHex hex;
- }
-
- #endif
#ifndef iostream
#define iostream
#include <cstdio>
#include <typeinfo>
namespace mystd{
class CEndl{};
class CHex{};
class CCout{
private:
bool hex;
public:
CCout(){
hex=false;
}
~CCout(){
}
template <class T> CCout& operator << (T t){
if(typeid(int) == typeid(t)){
if(hex == true){
printf("%X ", t);
hex = false;
}else
printf("%d ", t);
}else if(typeid(double) == typeid(t)){
printf("%f ", t);
}else if(typeid(float) == typeid(t)){
printf("%f ", t);
}else if(typeid(char *) == typeid(t)){
printf("%s ", t);
}else if(typeid(char) == typeid(t)){
printf("%c ", t);
}else if(typeid(CEndl) == typeid(t)){
printf("\r\n", t);
}else if(typeid(CHex) == typeid(t)){
hex = true;
}
return *this;
}
};
CCout cout;
CEndl endl;
CHex hex;
}
#endif