polynomial
본 자료는 미리보기를 지원하지 않습니다.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
해당 자료는 4페이지 까지만 미리보기를 제공합니다.
4페이지 이후부터 다운로드 후 확인할 수 있습니다.

목차

polynomial.cpp
polynomial.dsp
polynomial.dsw
polynomial.h
polynomial.opt
polynomial.plg
polynomial.sln
polynomial.suo
polynomial.vcproj
polynomial.vcproj.USER-COMPUTER.Administrator.user
polynomial.vcproj.도시발.홍.user
test.cpp

본문내용

#include
#include "polynomial.h"

using namespace std;

#define MAX(a,b) ((a>b) ? a : b)

polynomial::polynomial()
{
m_exp = 0;
m_coef = NULL;
}
polynomial::~polynomial()
{
if (m_coef)
{
delete [] m_coef;
m_coef = NULL;
}
}
polynomial::polynomial(int _exp)
{
m_exp = _exp;
m_coef = new int[m_exp+1];
for (int i=0; i<=m_exp; i++)
*(m_coef + i) = 0;
}
polynomial::polynomial(const polynomial & rhs)
{
m_exp = rhs.m_exp;
m_coef = new int[m_exp+1];
for (int i=0; i<=m_exp; i++)
{
m_coef[i] = rhs.m_coef[i];
}
}
void polynomial::SetExp(int _exp)
{
m_exp = _exp;
m_coef = new int[m_exp+1];
for (int i=0; i<=m_exp; i++)
*(m_coef + i) = 0;
}
void polynomial::SetCoef(int * _coef)
{
for (int i=0; i<=m_exp; i++)
{
m_coef[i] = _coef[i];
}
}
int polynomial::GetExp()
{
return m_exp;
}
int * polynomial::GetCoef()
{
return m_coef;
}
polynomial & polynomial::operator = (const polynomial & rhs)
{
if (this != &rhs)
{
delete [] m_coef;
m_exp = rhs.m_exp;
m_coef = new int[m_exp+1];
for (int i=0; i<=m_exp; i++)
{
m_coef[i] = rhs.m_coef[i];
}
}
return *this;
}

키워드

  • 가격2,000
  • 페이지수12페이지
  • 등록일2011.12.19
  • 저작시기2011.11
  • 파일형식압축파일(zip)
  • 자료번호#721826
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니