Practicas Dev C++
July 30, 2022 | Author: Anonymous | Category: N/A
Short Description
Download Practicas Dev C++...
Description
Ninkphjs poro Fnv-C++ HNEA^OIN C Wrjarokoc`óe fn Cjkputofjrns
Nh Fnv-C++ ej ns kos qun ue nf`tjr qun ejs pnrk`tn nscr`d`r eunstrjs prjarokos y qun nh cjev`nrtn ne `estrucc`jens fn koqu`eo poro snr nincutofos pjr nh cjkputofjr y prnsnetor hjs rnsuhtofjs. Nx`stn nf`tjrns nh Djrhoef C yoph`coc`jens v`suoh C++ netrn jtrjs qun hj qun jtrjs cokd`oe ns qun cjkj punfne tronr kïs j mnrrok`netos v`suohns pnrj ne nsnec`o pnrk`tn mocnr hj k`skj qun nh Fnv-C++. Nstjs sje ohauejs prjarokos poro Fnv-C++. ?. Nkpnzokjs cje nh kos snec`hhj nh lokjsj ‘Mjho Kuefj‛ #`echufn8cje`j.m5 #`echufn8stf`j.m5 ko`e() { pr`etl("Mjho Kuefj")2 antcm()2 rnture(7)2
//H`drnrëo poro nh antcm //H`drnrëo poro pr`etl //`e`c`j fn prjaroko pr`ec`poh //nscr`d`r, //fntnenr poro v`suoh`zor //Wrjcnsj l`eoh`zofj JB
} 4. @kpr`k`r nh cuofrofj fn ue eùknrj `earnsofj pjr nh usuor`j. #`echufn8cje`j.m5 #`echufn8stf`j.m5 ko`e() { //vor`odhns lhjot x,c2 //lhjot ; %l ;rnoh //`estrucc`jens pr`etl("F`a`tn ue euknrj")2 //nscr`d`r scoel("%l",&x)2 //hnnr c;x*x2 pr`etl("Nh cuofrofj fn %l ns %l",x,c)2 antcm()2 rnture(7)2 } S` sn hj fnsno punfn cokd`or pr`etl pjr cjut poro nscr`d`r y nh scoel fn hnnr pjr c`e, qun pnrtnencne o ho h`drnrëo `jstrnok.m
#`echufn8cje`j.m5 #`echufn8`jstrnok5 ko`e() { //vor`odhns lhjot x,c2 chrscr()2 //h`kp`or poetohho cjut88"F`a`tn ue euknrj"2 //nscr`d`r c`e55x2 //Hnnr c;x*x2 cjut88"Nh cuofrofj fn "88x88" ns "88c2 antcm()2 rnture(7)2 }
Ho `estrucc`óe cjut88nefh2 `ef`co oh prjaroko qun nincutn ue sohtj fn hëeno j ue Netnr, pnrk`t`nefj snporor knesoins pjr hëenos ne ho poetohho. 3. Cohcuhor nh ïrno fn ue tr`oeauhj, cuyos f`knes`jens sje `earnsofos pjr nh usuor`j #`echufn8cje`j.m5 #`echufn8`jstrnok5 us`ea eoknspocn stf2 ko`e() { //vor`odhns lhjot d,m,OV2 //`estrucc`jens cjut88"Nstn prjaroko cohcuho //netnr cjut88"F`a`tn nh vohjr fn ho c`e55d2 cjut88"F`a`tn nh vohjr fn ho c`e55m2 OV;(d*m)/42 cjut88"Nh Ïrno fnh Vr`oeauhj antcm()2 rnture(7)2 }
nh ïrno fn ue tr`oeauhj"88nefh2 dosn"2 ohturo"2 ns"88OV2
Ho nstructuros qun rnqu`nrne fn cjef`c`jeohns cjkj hj ns nh S@ y nh K@NEVTOS netrn jtrjs, ejs pnrk`tn prnsnetor cjef`c`jens cjkpunstos pjr knf`j fn jpnrofjr OEF (&&) y nh JT (||)
6. Fntnrk`eor nh koyjr fn 3 eùknrjs `earnsofjs pjr nh usuor`j. # `echufn 8cje`j.m5 # `echufn 8`jstrnok.m5 `et ko`e () { }
`et o,d,c2 cjut 88 "@earnsn nh pr`knr vohjr" 88nefh2 c`e 55 o2 cjut 88 "@earnsn nh snauefj vohjr" 88nefh2 c`e 55 d2 cjut 88 "@earnsn nh tnrcnr vohjr" 88nefh2 c`e 55 c2 `l ((o5;d) && (o5;c)) { cjut 88"Nh koyjr ns nh pr`knr vohjr" 88nefh 88 o2 } `l ((d5;o) && (d5;c)) { cjut 88"Nh koyjr ns nh snauefj vohjr" 88nefh 88 d2 } `l ((c5;o) && (c5;d)) { cjut 88"Nh koyjr ns nh tnrcnr vohjr" 88nefh 88 c2 } antcm ()2 rnture 72
Ejto9 ns fn rnsohtor qun ne nh `l pjr snr sjhj ueo `estrucc`óe ej ns
jdh`aotjr`j necnrror nsto `estrucc`óe fnetrj fn hhovns, nstj ns sjhj ueo nx`anec`o poro 4 j kïs `estrucc`jens >. @kpr`k`r hjs f`v`sjrns fn ue eùknrj `earnsofj pjr nh usuor`j. #`echufn8cje`j.m5 #`echufn8`jstrnok5 us`ea eoknspocn stf2 ko`e() { `et e,`;?2 cjut88"F`a`tn ue euknrj "2 c`e55e2 wm`hn(`8;e) { `l(e%`;;7) cjut88`88nefh2 } `++2 } antcm()2 rnture(7)2
//wm`hn ; K`netros //`l ;s`
} .
Necjetror nh ?7 pnsjs2 nscr`d`r ho pohodro sjdroetn s` nx`stn ue sjdroetn knejr fn >7, pjr ninkphj 67 y ue sjdroetn fn ?4 pnsjs. (ej `kpr`k`r hos kjenfos qun sn ut`h`zoe 7 vncns)
H`sto dïs`co fn Nrrjrns pjs`dhns Hjs s`au`netns sje pjr ousnec`o (k`ss`ea) fn sëkdjhj • Nrrjr WTJC?.CWW ?19 Stotnknet k`ss`ea 2 S`ae`l`co qun nh prjaroko hhokofj prjc?.cpp hhnaj mosto ho hëeno ?1 y necjetró ousnec`o fnh sëkdjhj (2) • Nrrjr WTJC?.CWW ?49 Stotnknet k`ss`ea { S`ae`l`co ousnec`o fn hhovn @zqu`nrfo. • Nrrjr WTJC?.CWW ?09 Stotnknet k`ss`ea } S`ae`l`co ousnec`o fn hhovn Fnrncmo. Sjhuc`óe9 ejrkohknetn nh sëkdjhj nsto ousnetn ne nsto j ne ho
hëeno oetnr`jr oh nrrjr. Hjs s`au`netns nrrjrns `ef`coe qun ne nh prjaroko prja3 ne hos hëenos ?7 y 4< nx`stne ueo pohodro necnrrofo ne cjk`hhos (' ') fnscjejc`fo poro cofo cosj y sjh`c`to ue prjtjt`pj, • Nrrjr WTJA3.CWW ?79 Luect`je 'cjut' smjuhf movn o prjtjtypn • Nrrjr WTJA3.CWW 4
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
crno ue prjaroko fn Sohufj fn D`nevne`fo oh ohukej `ef`coefj ofnkïs su 3. Sn Nspnc`oh`fof y Nfof.
Oph`coc`óe nincutofo (l0) Fnv C++
<
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
6. Cohcuhor nh vohjr fn x, sod`nefj qun ; ofnkïs hjs vohjrns eukàr`cjs fn o y d sje ?7 y 4.= rnspnct`voknetn.
Oph`coc`óe nincutofo (l0) Fnv C++
1
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
>. Cohcuhor nh vohjr fn x, sod`nefj qun ; ofnkïs hjs vohjrns eukàr`cjs fn o y d sje `earnsofjs fnsfn nh tnchofj.
Oph`coc`óe nincutofo (l0) Fnv C++
=
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
.>. . 4 ofnkïs hjs vohjrns eukàr`cjs fn o, d, c, f sje9 3, > =, -3 rnspnct`voknetn.
Oph`coc`óe nincutofo (l0) Fnv C++
0
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
1. Cohcuhor nh vohjr fn
sod`nefj qun ; + . + 7.>. 4 ofnkïs hjs vohjrns eukàr`cjs fn o, d, c, f sje `earnsofjs fnsfn nh tnchofj. y,
Oph`coc`óe nincutofo (l0) Fnv C++
?7
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
∔ =. Cohcuhor nh vohjr fn k, sod`nefj qun ; 4(∔) ofnkïs hjs vohjrns eukàr`cjs fn w,
x, y, z sje 3, ?, >, > , 4 rnspnct`voknetn.
Oph`coc`óe nincutofo (l0) Fnv C++
??
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
∔ 0. Cohcuhor nh vohjr fn k, sod`nefj qun ; 4(∔) ofnkïs hjs vohjrns eukàr`cjs fn w,
x, y, z sje `earnsofjs fnsfn nh tnchofj.
Oph`coc`óe nincutofo (l0) Fnv C++
?4
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
?7. ^t`h`zoefj nxprns`jens hhóa`cos, óa`cos, nhodjror ho todho fn vnrfof s`au`netn9 p ? ? 7 7
q ? 7 ? 7
↖
? 7 7 ?
Oph`coc`óe nincutofo (l0) Fnv C++
?3
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
A^@O 74
?6
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
?.
Sn crno ue prjaroko qun p` p`fn fn ueo nfof y hunaj n nvohùo vohùo s` ns koyjr fn nfof j ej hj ns.
Oph`coc`óe nincutofo (l0) Fnv C++
?>
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
4.
Sn crno ue prjaroko qun nvoh nvohùn ùn ho rns`stnec`o ne ue kotnr`oh, s` ns koyjr fn ?77 f`rï qun nstï optj.
Oph`coc`óe nincutofo (l0) Fnv C++
?<
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
3.
Sn crno ue prjaroko qun p`fn ue eùknrj y hunaj nvohùo s` f`cmj eùknrj ns por j `kpor.
Oph`coc`óe nincutofo (l0) Fnv C++
?1
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
6.
Sn crno ue prjaroko qun p`fn y hunaj nvohùo s` f`cmj eùknrj ns pjs`t`vj, enaot`vj enaot`vj j enutrj.
Oph`coc`óe nincutofo (l0) Fnv C++
?=
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
>.
Sn crno ue prjaroko qun p`fo nh oÿj octuoh y ue oÿj cuohqu`nro y hunaj nvohùo cuoetjs oÿjs moe posofj fnsfn nh oÿj cuohqu`nro mosto nh oÿj octuoh, ó cuoetjs oÿjs lohtoe fnsfn nh oÿj cuohqu`nro mosto nh oÿj octuoh.
Oph`coc`óe nincutofo (l0) Fnv C++
?0
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
7[ 8>7,[ 8>,?7[ 87,?3[ 8?3,? Cnet`arokjs, < K`h`arokjs) poro cjevnrt`rhj o ho ue`fof fn knf`fo snhncc`jeofo.
34
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
Oph`coc`óe nincutofo (l0) Fnv C++
33
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
, < u = rnpjrtor nh cuofrofj fnh eùknrj, s` nstn tnrk`eo ne 3, 6, 1 j 0 rnpjrtor nh euknrj kuht`ph`cofj pjr > y rnpjrtor nh k`skj eùknrj ne jtrj cosj.
Oph`coc`óe nincutofo (l0) Fnv C++
36
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
1. Sn crno ue pr prjaroko jaroko qun p` p`fo fo `earnsor 4 eùknrjs y hunaj nscjanr hho o jpnroc`óe qun sn qu`nrn mocnr cje nhhjs fnsfn ue kneù (? Suk Suko, o, 4 Tnsto, 3 Kuht`ph`coc`óe, 6 F`v`s`óe, > Cuofrofj, < Cudj), hunaj rnpjrtor nh rnsuhtofj.
3>
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
Oph`coc`óe nincutofo (l0) Fnv C++
3<
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
=. Sn crno ue pr prjaroko jaroko qun co cokd`n kd`n fn ue` ue`fofns, fofns, nh usuor`j hn prjpjrc`jeorï ueo hjea`tuf y ho ue`fof ne ho qun nstï knf`fo (cnetëkntrjs, b`hókntrjs, j puhaofos) y nh prjaroko posorï ho coet`fof `etrjfuc`fo o kntrjs
Oph`coc`óe nincutofo (l0) Fnv C++
31
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
0. Sn crno ue prjaroko qun cohcuhn nh `kpjrtn o poaor fn ue vnmëcuhj oh c`rcuhor pjr ueo outjp`sto. Nh vnmëcuhj pufn snr ueo d`c`chnto, ueo kjtj, ue outj j ue cok`óe. Sn fndn `earnsor nh t`pj fn \nmëcuhj, hjs b`hókntrjs rncjrr`fjs y s` ns cok`óe hos tjenhofos hhnvofos.
Nh `kpjrtn sn cohcuhoro snaùe hjs s`au`netns fotjs9 o) ^e `kpjrtn fn 7.> sjhns pjr bk poro ho d`c`chnto. d) Hos kjtjs y hjs outjs poaoroe 4 sjhns pjr Bk. c) Hjs cok`jens poaoroe > sjhns pjr Bk. kïs 3 sjhns pjr tjenhofo.
3=
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
Oph`coc`óe nincutofo (l0) Fnv C++
30
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
?7. Sn crno ue prjaroko qun rnoh rnoh`cn `cn ho jpc`óe snhncc`jeofo fn ocunrfj o hhj j s`au`netn9 o.- Ïrno fn tr`ïeauhj (Sjh`c`tor dosn y ohturo) d.- Ïrno fn Cuofrofj (Sjh`c`tor hofj) c.- Ïrno fn Cërcuhj (Sjh`c`tor rof`j) f.- Ïrno fn Tnctïeauhj (Sjh`c`tor dosn y ohturo) Hunaj kjstror hjs rnsuhtofjs snaùe hj nscja`fj
67
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
Oph`coc`óe nincutofo (l0) Fnv C++
6?
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
A^@O 76
64
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
?.
Sn crno ue prjaroko qun ``kpr`kn kpr`kn ne poetohho su ejkdrn cjkphntj > vncns.
Oph`coc`óe nincutofo (l0) Fnv C++
63
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
4.
Sn crno ue prjaroko qun `kpr`kn ne poetohho ‘Sjy nstuf`oetn fn @eane`nrëo‛ toetos
vncns cjkj sn hn `ef`qun fnsfn nh tnchofj.
Oph`coc`óe nincutofo (l0) Fnv C++
66
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
3.
Sn crno ue prjaroko qun ``kpr`kn kpr`kn ne poetohho hhjs js eùknrjs ccjesncut`vjs jesncut`vjs fnh ? oh ?77
Oph`coc`óe nincutofo (l0) Fnv C++
6>
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
6.
Sn crno ue prjaroko qun ``kpr`kn kpr`kn ne poetohho toetjs eùknrjs cjesncut`vjs cjkj ssn n hn `ef`qun fnsfn nh tnchofj, nkpnzoefj pjr nh eùknrj ?
Oph`coc`óe nincutofo (l0) Fnv C++
6<
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
>.
Sn crno ue prjaroko qun ``kpr`kn kpr`kn ne poetohho hhjs js eùknrjs p porns orns fnh 4 oh , ?7, ?1, 4?
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
?7. Sn crno ue prjaroko qun `kpr`ko ho snr`n fn eùknrj eùknrjss 47, ?6, =, 4,-6, -?7
Oph`coc`óe nincutofo (l0) Fnv C++
>4
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
??. Sn crno ue prjaroko q qun un `kpr`ko nh odncnfor`j ne hntros k`eùscuh k`eùscuhos. os.
Oph`coc`óe nincutofo (l0) Fnv C++
>3
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
?4. Sn crno ue prjaroko qun `kpr`ko nh odncnfor`j ne ljrko rnvnrso y ne koyùscuhos.
Oph`coc`óe nincutofo (l0) Fnv C++
>6
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
?3. Crnor ue prjaroko qun kunstrn ue kneù poro jdtnenr hos pjtnec`os (cuofrofj y cudj) y qun p`fo ue euknrj poro necjetror su pjtnec`o snhncc`jeofo, nh c`chj sn rnp`tn mosto qun sn hn `ef`qun soh`r
>>
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
Oph`coc`óe nincutofo (l0) Fnv C++
><
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
?6. Sn crno ue prjaroko q qun un kunstro ue kneù fn jpc`jens fn ïrnos (Cuofrofj, Tnctïeauhj, Vr`oeauhj y c`rcuhj), hunaj qun p`fo p `fo hjs vohjrns encnsor`js poro necjetror su ïrno fn ho jpc`óe snhncc`jeofo, nh c`chj sn rnp`tn mosto qun sn hn `ef`qun soh`r
>1
Cursj9
Ohajrëtk`co @
^e`vnrs`fof Wnruoeo fn C`nec`os n @eljrkït`co
Oph`coc`óe nincutofo (l0) Fnv C++
View more...
Comments