91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 5.32KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-02-01
  • 標簽:

資源簡介

#ifndef HUGEINT_H 
#define HUGEINT_H 
#include <iostream> 
using std::ostream; 
class HugeInt
{
friend ostream& operator<<(ostream&, const HugeInt&);
public:
HugeInt(long = 0); 
HugeInt( const char * ); 
HugeInt operator ( const HugeInt & ) const; 
HugeInt operator ( int ) const;  
HugeInt operator ( const char * ) const; 
bool operator==(const HugeInt&) const;  
bool operator!=( const HugeInt & ) const;  
bool operator<( const HugeInt & ) const; 
bool operator<=( const HugeInt & ) const;    
bool operator>( const HugeInt & ) const; 
bool operator>=( const HugeInt & ) const;  
HugeInt operator-( const HugeInt & ) const; 
HugeInt operator*( const HugeInt & ) const; 
HugeInt operator/( const HugeInt & ) const; 
void output();
    int getLength() const;
private:   
int integer[40];
}; 

#endif 

資源截圖

代碼片段和文件信息

#include
#include“hugeint.h“
using?namespace?std;
ostream&?operator<<(ostream&?output?const?HugeInt&?n)
{
int?i;
for?(i?=?0;?(n.integer[i]?==?0)?&&?(i?<=?39);?i++);
if?(i?==?40)
output?< else
for?(i;?i? {
output?< }
return?output;
}
HugeInt::HugeInt(long?num)
{
for?(int?i?=?0;?i? {
integer[i]?=?0;
}
for?(int?j?=?39;?num?!=?0?&&?j?>?0;?--j)
{
integer[j]?=?num?%?10;
num?/=?10;
}
}
HugeInt::HugeInt(const?char*?c)
{
for?(int?i?=?0;?i? integer[i]?=?0;
int?lenth?=?strlen(c);
for?(int?j?=?40?-?lenth?k?=?0;?j? if?(isdigit(c[k]))
integer[j]?=?c[k]?-?‘0‘;
}
HugeInt?HugeInt::operator+(const?HugeInt&?n)?const
{
HugeInt?temp;
int?carry?=?0;
for?(i

評論

共有 條評論