面向?qū)ο蟮腃++程序設(shè)計第六版課后習(xí)題答案第十一章_第1頁
面向?qū)ο蟮腃++程序設(shè)計第六版課后習(xí)題答案第十一章_第2頁
面向?qū)ο蟮腃++程序設(shè)計第六版課后習(xí)題答案第十一章_第3頁
面向?qū)ο蟮腃++程序設(shè)計第六版課后習(xí)題答案第十一章_第4頁
面向?qū)ο蟮腃++程序設(shè)計第六版課后習(xí)題答案第十一章_第5頁
已閱讀5頁,還剩50頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

Chapter11

FriendsandOverloadedOperators

1.SolutionstoandRemarksonSelectedProgrammingProblems

1.ModifyMoneyclass.

Nosolutionisprovidedforthisexercise.

2.Implementconstructorsandoverload?,?,+,and*forclassPair.

//Chapter11ProgrammingProblem#2

//EnhanceSelfTestProblem17bycompletingthe

//overloadingofoperator<<and>>forclassPair

//Implement:

//Thedefaultconstructor

//Aoneintparameterconstructorthat

//setsthefirstmembertotheparameter

//andthesecondto0.

//Atwointparameterconstructor.

//Overload*onaPairandanint

//(x,y)*c=(x*c,y*c)

//Overload+ontwoobjectsoftypePair.

//(a,b)+(c,d)=(a+c,b+d)

#include<iostream>

usingnamespacestd;

classPair

(

public:

Pair();

Pair(intfirst,intsecond);

Pair(intfirst);

1

Copyright?2007PearsonEducation,Inc.PublishingasPearsonAddison-Wesley

intaccessFirst();

intaccessSecond();

//othermembersandfriends

friendPairoperator+(constPairsAconstPair&);

friendPairoperator*(constPairs,int);

friendistream&operator>>(istream&,Pair&);

friendostreamSoperator<<(ostream&,constPair&);

private:

intf;

ints;

};

intmain()

(

Pairx;

Pairv(2,3);

Pairz(4);

cout<<x.accessFirst()<<endl;

cout<<x.accessSecond()<<endl;

cout<<y.accessFirst()<<endl;

cout<<y.accessSecond()<<endl;

cout<<z.accessFirst()<<endl;

cout<<z.accessSecond()<<endl;

cout<<endl;

cout<<Hx"<<x<<endl

<<ny"<<y<<endl

<<"z"<<z

<<endl<<endl;

x=y+z;

cout<<ny+z11<<x<<endl;

cout<<ny*2H<<y*2<<endl;

return0;

)

Pairoperator+(constPairsIhs,constPairsrhs)

(

returnPair(Ihs.f+rhs.f,Ihs.s+rhs.s);

)

Pairoperator*(constPair&Ihs,intrhs)

(

returnPair(Ihs.f*rhs,Ihs.s*rhs);

}

istream&operator>>(istream&ins,Pair&second)

(

charch;

ins>>ch;//discardinit'(,

ins>>second.f;

ins>>ch;//discardcomma

ins>>second.s;

ins>>ch;//discardfinal1(1

returnins;

}

ostreamsoperator<<(ostream&outs,constPairssecond)

(

outs<<1(1;

outs<<second.f;

outs<<“,”;//IfollowedtheAuthor1ssuggestionhere.

outs<<second.s;

outs<<H)";

returnouts;

)

Pair::Pair(intfirstValue,intsecondValue)

:f(firstValue),s(secondValue)

{//deliberatelyempty

}

Pair::Pair(intfirstValue)

:f(firstValue),s(0)

{//deliberatelyempty

)

Pair::Pair():f(0),s(0)

{//deliberatelyempty

)

intPair::accessFirst(){returnf;}

intPair::accessSecond(){returns;}

Samplerun

0

0

2

3

4

0

x(0,0)

y(2,3)

Z(4,0)

V+z(6,3)

y*2(4,6)

3-4.NoSolutionsProvided

5.RationalNumberClass

Thisclassimplementsrationalnumberofthetype2/3.

Requirements:

classRational;

privatedata:intn,(fractionnumerator)andintd

(fractiondenominator).

publicinterface:

constructors:

twointargs,toallowsettingrationaltoanylegal

value

oneintarg,toconstructrationalswithargnumerator

anddenominator1.

overload<<and>>toallowwritingtoscreeninform

325/430

andreadingitfromthekeyboardinthesameformat.

Notes:eithernordmaycontainanegativequantity.

overload+-*/<<=>>===

Putdefinitionsinseparatefileforseparatecompilation

Testprogramrequired.

//filerational.h

#ifndefRAT工ONAL_H_

#defineRAT工ONAL_H_

classRational

public:

Rational(intnumerator,intdenominator);

Rational(intnumerator);//setsdenominatorto1

Rational();//setsnumeratorto0,denominatorto1

friendRationaloperator+(constRationale,

constRational&);

friendRationaloperator-(constRationale<

constRational&);

friendRationaloperator*(constRationale,

constRationale);

friendRationaloperator/(constRationale,

constRational&);

friendbooloperator<(constRationalS,

constRational&);

friendbooloperator<=(constRationale,

constRationale);

friendbooloperator>(constRational&z

constRational&);

friendbooloperator>=(constnationals,

constRationale);

friendbooloperator==(constRationale,

constRational&);

friendostream&operator<<(ostream&,

constRational&);

friendistream&operator>>(istream&,

Rational&);

private:

intn;

intd;

};

voidnormalize(int&n,int&d);

#endif

//endfileRational.h

//file:chllprb4cc

//ImplementationsofthemembersofclassRational.

//ForChapter11Problem4

#include<iostream>

#include<cstdlib>

?include”rational?h”

usingnamespacestd;

//privatemembersofclassRational

//intn;

//intd;

Rational::Rational(intnumer,intdenom)

(

normalize(numer,denom);

n=numer;

d=denom;

)

//setsdenominatorto1

Rational::Rational(intnumer):n(numer),d(1)

//Seetheinitializerappendix

(

//bodydeliberatelyempty

)

//setsnumeratorto0,denominatorto1

Rational::Rational():n(0),d(1)

//seeinitializerappendix

(

//bodydeliberatelyempty

)

Rationaloperator+(constRational&left,

constRationalSright)

(

intnumer=left.n*right.d+left.d*right.n;

intdenom=left.d*right.d;

normalize(numer,denom);

Rationallocal(numerzdenom);

returnlocal;

)

Rationaloperator-(constRational&left,

constRational&right)

(

intnumer=left.n*right.d-left.d*right.n;

intdenom=left.d*right.d;

normalize(numer,denom);

Rationallocal(numer,denom);

returnlocal;

)

Rationaloperator*(constRational&left,

constRationalSright)

(

Rationalproduct;

intnumer=left.n*right.n;

intdenom=left.d*right.d;

normalize(numer,denom);

product=Rational(numer,denom);

returnproduct;

)

Rationaloperator/(constRational&left,

constRationalSright)

(

Rationalquotient;

intnumer=left.n*right.d;

intdenom=left.d*right.n;

normalize(numer,denom);

quotient=Rational(numer,denom);

returnquotient;

)

//precondition:allrelationaloperatorsrequired>0

booloperator<(constRational&left,

constRational&right)

(

returnleft.n*right.d<right.n*left.d;

)

booloperator<=(constRational&leftr

constRational&right)

(

returnleft.n*right.d<=right.n*left.d;

)

booloperator>(constRational&left,

constRationaleright)

(

returnleft.n*right.d>right.n*left.d;

}

booloperator>=(constRational&leftz

constRational&right)

(

returnleft.n*right.d>=right.n*left.d;

)

booloperator==(constRational&left,

constRationaleright)

(

returnleft.n*right.d==right.n*left.d;

)

//NOTE:

//Doinginputchangestheinputstreamstate.Thisseems

1

//obviousAbutIhavestudentswhodidntrealizethis.

//Thiscode,alongwithiostreamlibrary,goesintoan

//infiniteloopifyoumakeistreamaconstreference.

There

//arenoerrormessages,onlyaninfiniteloop,involving

//thesingleparameterconstructor.Thiscanbequite

//disconcertingtothenaivestudent.

//

//Bottomline:ThefirstparamMUSTNOTbeconst.The

//secondoneiswritten,soitcannotbeconsteither.

istreamSoperator>>(istream&in_str,RationalSright)

(

charch;

in__str>>right.n>>ch>>right.d;

if(ch!='/')//properlydone,wewouldsetiostream

//state

{//tofailhereincaseoferror.

cout<<"badinputformatforoperator>>.Aborting!H

<<endl;

exit(1);

)

normalize(right.n,right.d);

returnin_str;

}

//This,liketheabovecase,alongwithg++iostream

//library<goesintoaninfiniteloopwhenyouattemptto

//makeostreamaconstreference.

//Therearenoerrormessagesronlyaninfiniteloop,

//involvingthesingleparameterconstructor.

//

//Bottomline:Thefirstparametershouldnotbeconst,the

//secondisreadonlyandshouldbeconst.

ostream&operator<<(ostream&out_str,

constRational&right)

(

charch;

out_str<<right.n<<<<right.d;

returnout_str;

)

//postcondition:returnvalueisgcdoftheabsolutevalues

//ofmandndependsonfunctionintabs(int);declaredin

//cstdlib

intgcd(intm,intn)

intt;

m=abs(m);//don*tcareaboutsigns.

n=abs(n);

if(n<m)//makem>=nsoalgorithmwillwork!

(

t=m;

m=n;

n=t;

}

intr;

r=m%n;

while(r!=0)

{

r=m%n;

m=n;

n=r;

}

returnm;

}

//postcondition:nandd(tobenumeratoranddenominator

//ofafraction)haveallcommonfactorsremoved,andd>0.

voidnormalize(int&n,int&d)

(

//removecommonfactors:

intg=gcd(n,d);

n=n/g;

d=d/g;

//fixthingssothatifthefractionis1negative1

//itisnthatcarriesthesign.Ifbothnanddare

//negative,eachismadepositive.

if(n>0&&d<0||n<0&&d<0)

(

n=-n;

d=-d;

}

//assert:d>0

//endfilechllprb4.cc

//File:chllprb4.tst.cc

//File:testprogramforRationalclass

#include<iostream>

#include”rational.hH

usingnamespacestd;

intmain()

(

cout<<"Testingdeclarationsn<<endl;

cout<<"Rationalx,y(2),z(-5,-6),w(1,-3);<<endl;

Rationalx,y(2),z(-5,-6),w(l,-3);

cout<<"z="<<z<<",y="<<y<<”,zn<<z

<<",w=H<<w<<endl;

cout<<"Testing>>overloading:\nEnter”

<<Hafractionintheformat”

<<Hinteger_numerator/integer_denominator

<<endl;

cin>>x;

cout<<HYouenteredtheequivalentof:"<<x<<endl;

cout<<z<<"一("<<w<<")=n<<z-w<endl;

cout<<"Testingtheconstructorandnormalization

routines:“<<endl;

y=Rational(-128z-48);

cout<<Hy=Rational(-128,-48)outputsas"<<y<<endl;

y=Rational(-128,48);

cout<<ny=Rational(-128,48)outputsas"<<y<<endl;

y=Rational(128z-48);

H

cout<<y=Rational(128r-48)outputsas"<<y<<endl;

Rationala(1,1);

cout<<"Rationala(1,1);aoutputsas:"<<a<<endl;

Rationalww=y*a;

cout<<y<<n*“<<a<<H"<<ww<<endl;

w=Rational(25z9);

z=Rational(3,5);

cout<<"Testingarithmeticandrelational

<<"operatoroverloading11<<endl;

cout<<w<<<<z<<n=n<<w*z<<endl;

cout<<w<<<<z<<n=n<<w+z<<endl;

cout<<w<<<<z<<"=n<<w-z<<endl;

cout<<w<<<<z<<n="<<w/z<<endl;

cout<<w<<<H<<z<<”="<<(w<z)<<endl;

cout<<w<<<"<<w<<"="<<(w<w)<<endl;

cout<<w<<<="<<z<<"="<<(w<=z)<<endl;

cout<<w<<<="<<w<<H"<<(w<=w)<<endl;

cout<<w<<>H<<z<<"="<<(w>z)<<endl;

cout<<w<<>"<<w<<"="<<(w>w)<<endl;

cout<<w<<>="<<z<<"="<<(w>=z)<<endl;

cout<<w<<>="<<w<<H"<<(w>=w)<<endl;

w=Rational(-21,9);

z=Rational(3,5);

cout<<w<<"*n<<z<<"=n<<w*z<<endl;

cout<<w<<"+n<<z<<”="<<w+z<<endl;

cout<<w<<"-"<<z<<"=n<<w-z<<endl;

cout<<w<<"/n<<z<<”="<<w/z<<endl;

cout<<w<<"<H<<z<<“="<<(w<z)<<endl;

cout<<w<<"<n<<w<<"="<<(w<w)<<endl;

cout<<w<<"<="<<z<<“="<<(w<=z)<<endl;

cout<<w<<"<="<<w<<“="<<(w<=w)<<endl;

cout<<w<<">H<<z<<“="<<(w>z)<<endl;

cout<<w<<">n<<w<<”="<<(w>w)<<endl;

cout<<w<<">=H<<z<<“="<<(w>=z)<<endl;

cout<<w<<">="<<w<<“="<<(w>=w)<<endl;

return0;

)

//endfilechllprb4.tst.cc

Atypicalrunfollows

21:08:22:~/AW$rational>rational.out

45/35

21:08:34:-/AW$catrational.out

Testingdeclarations

Rationalx,y(2),z(-5,-6),w(lz-3);

z=5/6,y=2/1,z=5/6,w=-1/3

Testing<<overloading:

Enterafractionintheformat

integer__numerator/integer_denominator

Youenteredtheequivalentof:9/7

5/6-(-1/3)=7/6

Testingtheconstructorandnormalizationroutines:

y=Rational(-128,-48)outputsas8/3

y=Rational(-128,48)outputsas-8/3

y=Rational(128,-48)outputsas-8/3

Rationala(1,1);aoutputsas:1/1

-8/3*1/1=-8/3

Testingarithmeticandrelationaloperatoroverloading

25/9*3/5=5/3

25/9+3/5=152/45

25/9-3/5=98/45

25/9/3/5=125/27

25/9<3/5=0

25/9<25/9=0

25/9<=3/5=0

25/9<=25/9=1

25/9>3/5=1

25/9>25/9=0

25/9>=3/5=1

25/9>=25/9=1

-7/3*3/5=-7/5

-7/3+3/5=-26/15

-7/3-3/5=-44/15

-7/3/3/5=-35/9

-7/3<3/5=1

-7/3<-7/3=0

-7/3<=3/5=1

-7/3<=-7/3=1

-7/3>3/5=0

-7/3>-7/3=0

-7/3>=3/5=0

-7/3>=-7/3=1

6.ComplexNumbers

DefineanADTforcomplexnumbers.Theproblemspecifiesaformofa+i*bwherea

andbareoftypedouble,andiisthecomplexunit,squarerootof-1.Implement

operatoroverloadingfor==r+,-<*,>>,and<<.

Ihaveimplementedabitmorethanisrequired.TheproblemistoproduceanADTfor

complexnumbers.Theintentionisnottoproduceacomplexclassthatisparticularly

usable,rathertheintentistoproduceaclassthatisreasonablycompleteyetstill

understandabletothestudent.Evenso,Iacknowledgesomeoverkillfortheproblemas

specifiedinthetext.

Ihaveusedanexternalformdifferentfromthisspecification.TheISO/ANSIC++

Standardsaysthatthecomplexinserterandextractorshouldreadandwriteacomplex

numbersoftheform:re,(re),or(re,im),wherereistherealpartandimistheimaginary

part.ThisistheexternalformthattheC++compilerswillrequiredbytheISOStandard

forcompliantcompilers.

Iamonlyallowingtheexternalform(re,im).Icheckonlytheinputformat,andIdonot

checkforagoodstreamstateateachreadfromtheinputstream.Robustsoftware

requirescheckingthestreamstateateachfetch.

ThestudentshouldnotbeexpectedtohaveaknowledgeoftherequirementsoftheISO

C++Standard.Beforeassigningthisexercise,theinstructorshouldprovidethestudent

withinformationabouttheexternalformofacomplextheC++Standardexpects.

Notcoincidentally,theISOStandardrequiresafullyimplemented<complex>type

withoverloadedoperators,transcendentalfunctions,acomplexarraysincludingarray

slices,aspartoftheNumericslibrary.

//file:complex.h

//Chapter11,problem5:DefineanADTforcomplexnumbers.

#ifndef_COMPLEX_H

#defineCOMPLEXH

#include<cmath>

#include<iostream>

usingnamespacestd;

classcomplex

(

public:

complex(doubler=0,doublei=0):re(r),im(i){}

doublereal()constreturnre;}

doubleimag()constreturnim;}

private:

doublere,im;

frienddoublereal(constcomplex^);

frienddoubleimag(constcomplex&)

friendcomplexoperator+(constcomplex&jconst

complex&)

friendcomplexoperator(constcomplex&,

constcomplex^);

friendcomplexoperator*(constcomplexS,

constcomplex&);

friendcomplexoperator(constcomplex&,

constcomplex&);

friendbooloperator==(constcomplex&r

constcomplex&);

friendbooloperator!=(constcomplexS,

constcomplexS);

friendcomplexpolar(double,double);

friendistream&operator>>(istreams,complex^);

friendostream&operator<<(ostreams,constcomplex&);

);

doublenorm(constcomplexSx);

#endif

//file:complex.cpp

//Thisistheimplementationfileformembersofthe

//classcomplex.Theclassinterfaceisgivenincomplex.h

#include”complex?h”

#include<iostream>

ostreamsoperator<<(ostream&。,constcomplexsc)

(

o<<<<c.re<<",”<<c.im<<

returno;

)

//limitedcheckingofformatisdonehere.

istream&operator>>(istream&ins,complex^z)

(

doubler,i;

charch;

ins>>ch;

if(1(1!=ch)//ifthecomplexnumberisn11in

//requiredform,complainandexit.

(

cout<<n\nBadcomplexform:found”

<<ch<<",need(forcomplexinput;\n"

<<"Acomplexmustbeoftheform(re,im)\nH;

exit(1);

}

//Wehave1(f一一nowgettherealpart

ins>>r;

//andgetthecomma

ins>>ch;

if('J!=ch)//complexnumbermusthaveacommanext,

//ifnot,complainandexit.

(

cout<<n\nBadcomplexform:found”

<<ch<<",needcommaforcomplexinput;\nn

<<"Acomplexmustbeoftheform(re,im)\nH;

exit(1);

)

//nowgettheimaginarypart

ins>>i;

//andgetthecloseparenthesis

ins>>ch;

if(*),!=ch)//complexnumbermusthavea1)Tlast,

//Ifnot,complainandexit.

{

cout<<"\nBadcomplexform:found”

<<ch<<”,need)forcomplexinput;\n"

<<”Acomplexmustbeoftheform(re,im)\nH;

exit(1);

}

z=complex(r,i);

returnins;

)

doubleimag(constcomplex&x)

(

returnx.imag()

)

doublereal(constcomplex&x)

(

returnx.real

)

complexoperator+(constcomplex&x,constcomplexSy)

(

returncomplex(real(x)+real(y),imag(x)+imag(y));

)

complexoperator-(constcomplex&x,constcomplex&y)

(

returncomplex(real(x)-real(V),imag(x)-imag(y));

)

complexoperator*(constcomplex&x,constcomplex&y)

(

returncomplex(real(x)*real(y)-imag(x)*imag(y),

real(x)*imag(y)+imag(x)*real

(y));

)

complexoperator/(constcomplex&x,doubley)

returncomplex(real(x)/y,imag(x)/y);

)

booloperator(constcomplex&xconstcomplex&y)

returnreal(x)==real(y)&&imag(x)imag(y);

)

booloperator!=(constcomplex&xconstcomplexSy)

returnreal(x)=real(y)||imag(x)!=imag(y);

)

doubleabs(constcomplex&x)

returnsqrt(norm(x));

)

complexconj(constcomplexSx)

(

returncomplex(real(x),-imag(x));

)

doublenorm(constcomplexSx)

(

returnreal(x)*real(x)+imag(x)*imag(x);

)

//Divideoverloading:Thereisapossiblebughere.

//Theusualtoolforcomplexdivision,num/den=

//num*conj(den)*(1/(den*conj(den)),causesaninfinite

//recursion.

//Exercise:Howandwhy?

complexoperator/(constcomplexsnum,constcomplex&den)

(

return(num*conj(den)*(1/norm(den)));

)

//file:tstcmplx.cpp

//Totestcomplex.handcomplex.cppclass,membersand

//friends

#include”complex.hn

#include”cmath"

usingnamespacestd;

//compilecommand:g++testcomplex.cppcomplex-io.cpp

intmain()

(

//testconstructors

complexx,y(3),z(-3?2,2.1);

COUt<<nX="<<x<<"y="<<y

<<"z="<<z<<endl<<endl;

x=complex(3,-4);

cout<<"testingmembersandsupportfunctionsas”

<<”wellasoutputoperator:\nn

<<"complexnumberx=H<<x<<endl

<<"realpart:"<<x.real()<<endl

<<"realpartfromfriendreal(x):“

<<real(x)<<endl

<<"imaginarypart:“<<x.imag()<<endl

<<nimaginarypartfromfriendimag(x):

<<imag(x)<<endl

<<"norm:“<<norm(x)<<endl<<endl;

cout<<"testcomplexarithmeticandoutput

<<”routines:\n\nM;

y=complex(1,-1);

cout<<Hx="<<x<<"y="<<y

<<nz="<<z<<endl<<endl;

z=x+y;

cout<<”z=x+y<<z<<endl;

z=x*y;

cout<<nz=x*y=<<z<<endl;

z=x-y;

cout<<"z=x-y<<z<<endl;

z=x/y;

cout<<”zx/y=n<<z<<endl<<endl;

//testofautomaticconversiondouble->complexbythe

//constructor.

doubled(2.0);

cout<<"d:"<<d<<"x:"<<x<<endl;

cout<<”x+d:";

z=x+d;

cout<<z<<endl;

z=x-d;

cout<<nx-d:";

cout<<z<<endl

Z=X*d;

cout<<nx*d:H;

cout<<z<<endl

Z=X/d;

cout<<nx/d:";

cout<<z<<endl

z=d+x;

cout<<nd+x:";

cout<<z<<endl

z=d-x;

cout<<nd-x:";

cout<<z<<endl

z=d*x;

cout<<nd*x:";

cout<<z<<endl

z=d/x;

cout<<nd/x:";

cout<<z<<endl

//testwhetherdouble/complexandcomplex/complex

//givesameresult:

complextwo(2,0);

cout<<Htwo/x:H;

cout<<two/x<<endl;

cout<<H\nGettingdatafromstandardinput:\nH;

cin>>x>>y;

cout<<"datareadis:x=n<<x

<<"y="<<y<<endl<<endl;

return0;

Testdataandatestrun:

Thecontentofthefile,good-data,is:

(1,1)

(2,3)

Hereistheoutputfromourinputroutinewhengivenbaddata.

x=(0,0)y=(3,0)z=(-3.2,2.1)

testingmembersandsupportfunctionsaswellasoutput

operator:

complexnumberx=(3,-4)

realpart:3

realpartfromfriendreal(x):3

imaginarypart:-4

imaginarypartfromfriendimag(x):-4

norm:25

Wetestcomplexarithmeticandoutputroutines.

x=(3,-4)y=(1,-1)z=(-3.2,2.1)

z=x+y=(4,-5)

z=x*y=(-1,-7)

z=x-y=(2,-3)

z=x/y=(3.5,-0.5)

d:2x:(3,-4)

x+d:(5,-4)

x-d:(1,-4)

x*d:(6,-8)

x/d:(1.5,-2)

d+x:(5,-4)

d-x:(-1,4)

d*x:(6,-8)

d/x:(0.24,0.32)

two/x:(0.24,0.32)

Gettingdatafromstandardinput:

datareadis:x=(1,1)y=(2,3)

Messagesfromtheinputroutinewhengivenbaddata.

Thecontentofthefile,bad-datal,is:

(12)

Themessagesfromtheinputroutinewiththisfilefordatafollow.

[???snip...]

Gettingdatafromstandardinput:

Badcomplexform:found2rneedcommaforcomplexinput;

Acomplexmustbeoftheform(re,im)

Thecontentofthefile,bad-data2,is:

(1,2)

(1,2_

Themessagesfromtheinputroutinewiththisfilefordatafollow.

[...snip???]

Gettingdatafromstandardinput:

Badcomplexform:foundneed)forcomplexinput;

Acomplexmustbeoftheform(re,im)

7.NoSolutionProvided

8.NoSolutionProvided

9.NoSolutionProvided

10.NoSolutionProvided

11.NoSolutionProvided

12.

I/***************************************************************

//

//ChllProj12.cpp

//

//ThisprogramdefinesaclassforstoringasetofSTLstrings.

//The+operatorunionstwosetsandthe*operatorintersect

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論