/*
Name: 类C通用模块
Copyright: BTC 2004
Author: Zhuang Bo
Date: 2004
Description:
[Constants]
TRUE/FALSE/OK/ERROR/INFEASIBLE/DS_OVERFLOW
[Types]
Status
[Functions]
max(a,b)
min(a,b)
read(char/int/float/double/char*)
write(char/int/float/double/char*)
*/
#ifndef _DS_H_
#define _DS_H_
// 函数结果状态代码
const int TRUE = 1;
const int FALSE = 0;
const int OK = 1;
const int ERROR = 0;
const int INFEASIBLE = -1;
const int DS_OVERFLOW = -2;
// Status 是函数的类型,其值是函数结果状态代码
typedef int Status;
//基本函数
#define max(a,b) (((a)<(b))?(b):(a))
#define min(a,b) (((a)<(b))?(a):(b))
#include <stdio.h>
//不用格式串的输入输出(目的是为了方便书写算法)
// 比如输入一个基本类型(char, int, float, double, char*)的
// 变量 x,可以直接用 read(x);输入,而打印则用 write(x);。
// 对于自定义类型,可以继续扩充。
inline void readM(char& e) { getchar(); e = getchar(); }
inline void read(char& e) { e = getchar(); }
inline void read(int& e) { scanf("%d", &e); }
inline void read(float& e) { scanf("%f", &e); }
inline void read(double& e) { scanf("%lf", &e); }
inline void read(
一元多项式相加减(数据结构)
最新推荐文章于 2022-04-18 17:21:25 发布