#ifndef __INCLUDED_VITAL #define __INCLUDED_VITAL #include #include #include #pragma warning (disable:4305) extern int qwqwqwignorethis; const char * const hversion="vital 1.02.006 of 30th May 2002"; int CheckSameVersions(void); class string { protected: char *data; int max, len; public: string(void); string(int mx); string(const char *s); string(const string &s); ~string(void); char *getcstr(void) const; char *c_str(void) const; string &operator=(const string &s); string &operator=(const char *s); bool operator==(const string &s) const; bool operator!=(const string &s) const; bool operator<(const string &s) const; bool operator>(const string &s) const; bool operator<=(const string &s) const; bool operator>=(const string &s) const; int length(void) const; int maximum(void) const; string &append(const char *s, int len); string &append(const string &s); string &append(const char *s); string &append(char c); string operator+(const string &s); string operator+(const char *s); string operator+(char c); string substring(int begin, int end); int to_int(int &ok=qwqwqwignorethis); char &character(int n) const; char &operator[](int n) const; }; int length(const string &s); char character(const string &s, int i); bool operator==(const char *x, const string &s); bool operator!=(const char *x, const string &s); bool operator<(const char *x, const string &s); bool operator>(const char *x, const string &s); bool operator<=(const char *x, const string &s); bool operator>=(const char *x, const string &s); class output_object { protected: FILE *ofile; public: output_object(void); void print_char(char c); void print(int n); void print(double f); void print(float f); void print(const char *s); void print(const string &s); void print(__int64 x); void newline(void); void flush(void); void close(void); }; class screen_object: public output_object { public: screen_object(void); void close(void); }; class output_file: public output_object { public: output_file(void); output_file(char *filename); output_file(string &filename); }; const int input_object_maxlen=1000; class input_object { protected: FILE *ifile; char line[input_object_maxlen+2]; char *t; int nextch(void); void backch(int c); char *read_charstar(void); public: input_object(void); bool ok; void rewind(void); void next_line(void); void read(char &c); void read_char(char &c); void read(int &i); void read(float &f); void read(double &f); void read(string &s); void read(__int64 &x); char read_char(void); char *read_line(void); int read_int(void); float read_float(void); double read_double(void); __int64 read_longlongint(void); string read_string(void); void close(void); }; class keyboard_object: public input_object { public: keyboard_object(void); void close(void); }; class input_file: public input_object { public: input_file(void); input_file(char *filename); input_file(string &filename); }; class string_scanner: public input_object { public: string_scanner(void); string_scanner(string s); void rewind(void); void read(char &c); void read(int &i); void read(float &f); void read(double &f); void read(string &s); char read_char(void); char *read_line(void); void read_char(char &c); int read_int(void); int read_digit(void); float read_float(void); double read_double(void); string read_string(void); void close(void); protected: char *read_charstar(void); int pos, len; }; class timer_object { protected: int thedate, thetime, themilliseconds, theseconds; public: timer_object(void); void look_at_the_clock(); int integer_date(void); int integer_time(void); int integer_ms(void); double double_time(void); }; extern screen_object screen; extern keyboard_object keyboard; extern timer_object timer; void look_at_the_clock(void); int integer_date(void); int integer_time(void); int integer_ms(void); double double_time(void); void print_char(char c); void print(int n); void print(float f); void print(double f); void print(const char *s); void print(const string &s); void print(__int64 x); void newline(void); void flush(void); void read(char &c); void read_char(char &c); void read(int &n); void read(float &f); void read(double &f); void read(string &s); void read(__int64 &x); char read_char(void); int read_int(void); float read_float(void); double read_double(void); char read_char(void); string read_string(void); string read_line(void); __int64 read_longlongint(void); void delay(double t); void randomise(void); void randomize(void); void do_not_randomise(void); void do_not_randomize(void); int random_in_range(int a, int b); float random_in_range(float a, float b); double random_in_range(double a, double b); #endif