Popo popoo o poo o (46595)















:

Popo popoo o poo o



i


1.

2. i po oi iooi o

3. po ip o

4. po pio pp o

5. p op o

6. pop



1.


o: i opi o. o o ii o ii oᒺ o.

o o, o opio op pop o o opi oo p pp, o oi oo o ( o ii ). o opio pi i opi o. ip opi , o op o ooo i, o oo opi, : oᒺ, p, pi o, po pii, pip oi oo oi. i o pii ix opi opio op oᒺ oo o poo x opi oᒺ o pi.



2. i po oi iooi o


p o poo i, o i o oi.

po o oo poi , o. poi o. o o po oi opi popoo o, i o pii i opi o. oi o poo opi p oi opi o.

ioio o po oi pop o o o o ip i:

o o i ;

o;

o x opi.

ooioo io o o pi i i opi:

oᒺ o;

p o;

pi o;

p pi o;

pip oi oi.

Oᒺ o: po i opi o, i i po po o.

p o: po o opi o, i ii po po o .

Po pii ox o o, i i i , i pi oi ix i po po o.

Po po pii ox o o, i i , i pi oi , i pi oi ix i oox o.


3. po ip o


Ip o i o o, o o opi poi poo o. oo oi, o op o i p x oi, o, o pii oi pio o o.

o ip oo o o i:

opop ;

i o o;

iop;

i o o;

i opop o.

opop oo p opi oᒺ . o opop pp p o iooo .

o o i opo i Input. i i p pp. p pp o, ii i o , p o.

Iop op oo, o op i op o o i o, p pooi ooip o. Iop p pp i o.

o o p p i ToString.

i opop o:

opop oᒺ +. opop + ip, o i op pp. p pp o, p o o. i op p o opi o. i o oᒺ ox px o.

opop p *. * ip opi, i p pp, i o. i op p o opi o. i o p ox px o.

opop pii . i op pp. p pp o, p o o. i op p o opi o. i o pi ox px o.

opop po pii ^. ^ ip opi, o i p pp, i o. i o p pi ox px o. i op p o opi o.

opop pip oi oi /. / ip opi, o i p pp o i o. i o pip oi oo oi. i op p o opi i.

i opop i, # opop oo .


4. po pio pp o


pi o oi oi, o o op poi poo o.

o pio oo o , o-p, o X . o iip po o. o oiop o privt, oo o pxo i op oo, o op i i i , i p iop o, o . o-p, pii i o, opopi o.

opop, oo p opi oᒺ, p i o, ii i o. oi opop op i ii i, o i oo.

o o i opio . oo opo i Input. i op pp: o i i o. o o o oo: o o o p. o p p pi, o o o oo o i . o p, o op i oo op . i op , opo .

o o p p i ToString. i op ix ppi, i op o i, p o.

Opop oᒺ +. Opop p, pp i o. op oᒺ x o . o i o i po o. oi o pi p po o i pip i o, o oo i , o i o . oi op o o, oi i ioo . Opop p opi op o o.

Opop p *. Opop p o p o o. o o pi p po o pip po o, o i i, o o o op i . oi op o o, oi i ioo . Opop p opi op o o.

Opop pii . Opop p, pp i o. op pii x o . o o pi p po o pip po o, o i i, o o o op i . oi op o o, oi i ioo . Opop p opi op o o.

Opop po pii ^. Opop p o p o o. o o pi p po o pip po o, o i i, o o o o i . oi o pi p po o pip po o, o i i, o o o op i . oi op o o, oi i ioo . Opop p opi op o o.

Opop oi oi /. Opop p, pp o io . op opop . p i pip o, o i oi, o p op i i tru, o i fls.

ip i.

oi i oo o po P 1.

ip i o, o Clss 1 (oo pop) opo Consol o ox pi poo. o Clss 1 op oᒺ St i oo opo. ipi i o i o o i o , o o oo i op St. rry po xo St, oo rry xo o St op o. pi oo opop St op oᒺ . o ipi i oo i o pi i .


Po 1 ip i


5. p op o


o poii i p o, i op op o.

1. i ooo pop pi pop o:

St st11 = nw St(kil11);

op oᒺ st11 St ii i kil11 x x, pp opop. o op ii oᒺ St. - St.Input(st11, "SI");

i Input St o o , st11 oᒺo St, SI poo i o. i i ix oᒺi.

2. pop o:

St st1 = st11 + st12;

op o o oᒺ st1. Opop + p o oᒺ st1. oᒺ po o opi +, o o o opi oᒺ o st11 i st12.

St st2 = st21 * st22;

op o o oᒺ st12. Opop * p o oᒺ st2. oᒺ po o opi *, o o o opi p o st21 i st22.

St st = st1 st2;

op o o oᒺ st1. Opop - p o oᒺ st. oᒺ po o opi -, o o o opi pii o st1 i st2.

St st4 = st41 ^ st42;

op o o oᒺ st14. Opop ^ p o oᒺ st4. oᒺ po o opi ^, o o o opi po pii o st41 i st42.

. pop o:

bool s = st51 / k51;

if (s)

Consol.WritLin(" : {0} oi SI", k51);

ls Consol.WritLin(" : {0} oi SI", k51);

i s oio i po o opi / pip oi k51 oi st51. Opop / op ii s: tru o fls. oi pip i io. o tru oi, o fls .

4. o pi x opi i pop pop o:

Consol.WritLin("SI: {0}", st11);

Consol.WritLin("SII: {0}", st12);

Consol.WritLin("Oᒺ o SI i SII: {0}", st1);

poo: oo o oᒺi st11, st12, st1 ioio. p o x oᒺi oo pop po oi oooo poo o ToString.


6. pop


St.cs:

using Systm;

using Systm.Collctions;

nmspc MySt

{ public clss St

{rry X; public St(int x)

{ this.X = nw int[x];}

// --------------------opi o o-------------------

public sttic St oprtor + (St s1, St s2)

{try

{rryList rlist1 = nw rryList();

//rry.Sort(s1.X);

for (int i=0; i

{rlist1.dd(s1[i]);

}

bool flg=fls;

//rry.Sort(s2.X);

for (int i=0; i

{ for (int j=0; j

{ flg=fls;

if(s2[i]==(int)rlist1[j])

{ flg=tru;

brk;}

}

if (!(flg)) rlist1.dd(s2[i]);}

St s = nw St(rlist1.Count);

for(int i=0; i

s[i]=(int)rlist1[i];

rturn s;}

ctch (xcption )

{Consol.WritLin(.Mssg);

rturn null;}

}

// ---------------------opi p o---------------------

public sttic St oprtor * (St s1, St s2)

{try

{

rryList rlist2 = nw rryList();

//rry.Sort(s1.X);

//rry.Sort(s2.X);

for (int i=0; i

{for (int j=0; j

{if(s1[i]==s2[j])

{rlist2.dd(s1[i]);

brk;}

}

}

St s = nw St(rlist2.Count);

for(int i=0; i

s[i]=(int)rlist2[i];

rturn s;}

ctch (xcption )

{ Consol.WritLin(.Mssg);

rturn null;}

}

// ---------------------opi pii o---------------------

public sttic St oprtor - (St s1, St s2)

{try

{rryList rlist = nw rryList();

//rry.Sort(s1.X);

//rry.Sort(s2.X);}

ctch (xcption )

{

Consol.WritLin(.Mssg);

rturn null;

}

}

// ---------------------opi po pii o------------------

public sttic St oprtor ^ (St s1, St s2)

{try

{rryList rlist = nw rryList();

//rry.Sort(s1.X);

//rry.Sort(s2.X);

bool flg=fls;

// --------------------------pi s1 - s2-------------------

for (int i=0; i

{for (int j=0; j

{flg=fls;

if (s1[i]==s2[j])

{flg=tru;

brk;}

}

if (!(flg)) rlist.dd(s1[i]);

}

// --------------------------pi s2 - s1----------------------

for (int i=0; i

{for (int j=0; j

{flg=fls;

if (s2[i]==s1[j])

{flg=tru;

brk;}

}

if (!(flg)) rlist.dd(s2[i]);}

St s = nw St(rlist.Count);

for(int i=0; i

s[i]=(int)rlist[i];

rturn s;}

ctch (xcption )

{Consol.WritLin(.Mssg);

rturn null;}

}

//-------------pip oi oi-----------------

public sttic bool oprtor / (St s1, int k)

{bool flg=fls;

for (int i = 0; i < s1.X.Lngth; i++)

{if (k==s1[i])

{flg = tru;

brk;

((ss[i]!='1')&&(ss[i]!='2')&&(ss[i]!='')&&(ss[i]!='4')&&(ss[i]!='5')&&(ss[i]!='6')&&(ss[i]!='7')&&(ss[i]!='8')&&(ss[i]!='9')&&(ss[i]!='0'))

{Consol.WritLin("Invlid vlu!");

goto pov0;}

int ction= Convrt.ToInt2(ss);

if ((ction!=1) && (ction!=2)) goto pov0;

switch(ction)

{cs 1:

int min =0, mx=s.X.Lngth+s.X.Lngth;

for (int i = 0; i < s.X.Lngth; i++)

{pov1: int rr=rn.Nxt(min, mx);

if(s/rr==tru) goto pov1; // opi - / - o

ls s[i]=rr;}

brk;

cs 2:

Consol.WritLin("-------- o {0} --------", str);

for (int i = 0; i < s.X.Lngth; i++)

{pov2: Consol.Writ("s[{0}] ",i);

int r = int.Prs(Consol.RdLin());

if (s/r==tru)

{Consol.WritLin("This lmnt lrdy xists!");

goto pov2;}

ls s[i]=r;

}

brk;}

}

ctch (xcption )

{Consol.WritLin(.Mssg);

}

}

//----------------------- o p o Output-----------------

/*public sttic void Output (St s, string str)

{try

{Consol.Writ("{0}: ", str);

for (int i = 0; i < s.X.Lngth; i++)

Consol.Writ("{0:N0} ", s[i]);

Consol.WritLin();

}

ctch (xcption )

{Consol.WritLin(.Mssg);

}

}*/

public ovrrid string ToString()

{string s="";

for(int i=0;i

s+=" "+X.GtVlu(i);

rturn s;}

//-----------------------iop----------------------------

public int this [int i]

{gt

{if ((i<0) || (i>X.Lngth)) throw nw IndxOutOfRngxcption("I o i !");

rturn (int)X.GtVlu(i);}

st

{if ((i<0) || (i>X.Lngth)) throw nw IndxOutOfRngxcption("I o i !");

X.StVlu(vlu, i);}

}

}

}

lss1.cs:

using Systm;

nmspc MySt

{clss Clss1

{sttic void Min(string[] rgs)

{whil (tru)

{try

nsol.Writ("i ");

int ction=int.Prs(Consol.RdLin());

switch(ction)

{cs 1:// o o

pov0: Consol.Writ("i - i o SI: ");

string ss = Consol.RdLin();

for (int i=0;i

if ((ss[i]!='1')&&(ss[i]!='2')&&(ss[i]!='')&&(ss[i]!='4')&&(ss[i]!='5')&&(ss[i]!='6')&&(ss[i]!='7')&&(ss[i]!='8')&&(ss[i]!='9')&&(ss[i]!='0'))

{Consol.WritLin("Invlid vlu!");

goto pov0;

}

int kil11 = Convrt.ToInt2(ss);

St st11 = nw St(kil11);

St.Input(st11, "SI");

Consol.Writ("i - i o SII: ");

int kil12 = int.Prs(Consol.RdLin());

St st12 = nw St(kil12);

St.Input(st12, "SII");

St st1 = st11 + st12;

// o p o Output

/*St.Output(st11, "SI");

St.Output(st12, "SII");

St.Output(st1, "O o SI i SII");*/

Consol.WritLin("SI: {0}", st11);

Consol.WritLin("SII: {0}", st12);

Consol.WritLin("O o SI i SII: {0}", st1);

brk;

cs 2:// p o

pov1: Consol.Writ("i - i o SI: ");

string ss1 = Consol.RdLin();

for (int i=0;i

if ((ss1[i]!='1')&&(ss1[i]!='2')&&(ss1[i]!='')&&(ss1[i]!='4')&&(ss1[i]!='5')&&(ss1[i]!='6')&&(ss1[i]!='7')&&(ss1[i]!='8')&&(ss1[i]!='9')&&(ss1[i]!='0'))

{Consol.WritLin("Invlid vlu!");

goto pov1;}

int kil21 = Convrt.ToInt2(ss1);

St st21 = nw St(kil21);

St.Input(st21, "SI");

Consol.Writ("i - i o SII: ");

int kil22 = int.Prs(Consol.RdLin());

St st22 = nw St(kil22);

St.Input(st22, "SII");

St st2 = st21 * st22;

// o p o Output

/*St.Output(st21, "SI");

St.Output(st22, "SII");

St.Output(st2, "p o SI i SII");*/

Consol.WritLin("SI: {0}", st21);

Consol.WritLin("SII: {0}", st22);

Consol.WritLin("p o SI SII: {0}", st2);

brk;

cs :// pi o

pov2: Consol.Writ("i - i o SI: ");

string ss2 = Consol.RdLin();

for (int i=0;i

if ((ss2[i]!='1')&&(ss2[i]!='2')&&(ss2[i]!='')&&(ss2[i]!='4')&&(ss2[i]!='5')&&(ss2[i]!='6')&&(ss2[i]!='7')&&(ss2[i]!='8')&&(ss2[i]!='9')&&(ss2[i]!='0'))

{Consol.WritLin("Invlid vlu!");

goto pov2;}

WritLin("Pi o SI SII: {0}", st);

brk;

cs 4:// p pi o

pov: Consol.Writ("i - i o SI: ");

string ss4 = Consol.RdLin();

for (int i=0;i

if ((ss4[i]!='1')&&(ss4[i]!='2')&&(ss4[i]!='')&&(ss4[i]!='4')&&(ss4[i]!='5')&&(ss4[i]!='6')&&(ss4[i]!='7')&&(ss4[i]!='8')&&(ss4[i]!='9')&&(ss4[i]!='0'))

{Consol.WritLin("Invlid vlu!");

goto pov;}

int kil41 = Convrt.ToInt2(ss4);

St st41 = nw St(kil41);

St.Input(st41, "SI");

Consol.Writ("i - i o SII: ");

int kil42 = int.Prs(Consol.RdLin());

St st42 = nw St(kil42);

St.Input(st42, "SII");

St st4 = st41 ^ st42;

// o p o Output

/*St.Output(st41, "SI");

St.Output(st42, "SII");

St.Output(st4, "Pi o SI i SII");*/

Consol.WritLin("SI: {0}", st41);

Consol.WritLin("SII: {0}", st42);

pov6: Consol.Writ("i pip: ");

string sss = Consol.RdLin();

for (int i=0;i

if ((sss[i]!='1')&&(sss[i]!='2')&&(sss[i]!='')&&(sss[i]!='4')&&(sss[i]!='5')&&(sss[i]!='6')&&(sss[i]!='7')&&(sss[i]!='8')&&(sss[i]!='9')&&(sss[i]!='0'))

{Consol.WritLin("Invlid vlu!");

goto pov6;}

int k51 = Convrt.ToInt2(sss);

bool s = st51 / k51;

// o p o Output

//St.Output(st51, "SI");

Consol.WritLin("SI: {0}", st51);

if (s)

Consol.WritLin(" : {0} oi SI", k51);

ls Consol.WritLin(" : {0} oi SI", k51);

brk;}

if (ction==0) brk;

}

ctch (xcption )

{Consol.WritLin(.Mssg);}

}

}

}

}

2