#pragma once
#include<iostream>
#include<cassert>
#include<fstream>

#define THREE (unsigned char)3
#define SIX (unsigned char)6
class Vec_ZZ_p
{
public:
	Vec_ZZ_p(int len);//初始化一个长为len的空数组
	~Vec_ZZ_p(void);
	Vec_ZZ_p(const Vec_ZZ_p&);
	Vec_ZZ_p&operator=(const Vec_ZZ_p&);

	int getlength()const;

	void put(int index,unsigned char num);
	friend Vec_ZZ_p operator+(const Vec_ZZ_p &a,const Vec_ZZ_p& b);  
    friend Vec_ZZ_p operator-(const Vec_ZZ_p &a,const Vec_ZZ_p& b); 
	Vec_ZZ_p& operator+=(const Vec_ZZ_p &a);
	Vec_ZZ_p& operator-=(const Vec_ZZ_p &a);
	friend Vec_ZZ_p operator*(int a,const Vec_ZZ_p& b);  
	friend Vec_ZZ_p operator*(const Vec_ZZ_p& b,int a);  
	friend Vec_ZZ_p operator%(const Vec_ZZ_p& b,int a); 
	unsigned char& operator[](unsigned int index);
	unsigned char& operator[](unsigned int index)const;
		
	//friend std::ofstream &operator<<(std::ofstream &os,const Vec_ZZ_p &a);
	//friend std::ifstream &operator>>(std::ifstream &is,Vec_ZZ_p &a);
	void print();//4种形式的输出重载
	friend std::ostream & operator<<(std::ostream &os,const Vec_ZZ_p& );
	bool SaveToTxt(const char *filename);//保存为文件
	bool LoadFromTxt(const char *filename);//从文件读取
private:
	unsigned char* v;
	int length;   
	
};

