01.03.2013 Views

g. surgulaZe, g. janeliZe, i. xuciSvili

g. surgulaZe, g. janeliZe, i. xuciSvili

g. surgulaZe, g. janeliZe, i. xuciSvili

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

moviyvanoT programa, romelic klaviaturidan Semosul<br />

mimdevrobaSi daiTvlis simboloebis, sityvebis da striqonebis<br />

raodenobas. sityva – simboloebis nebismieri mimdevrobaa, romelic ar<br />

Seicavs xarvezebs, axal striqonze gadasvlisa da tabulaciis<br />

simboloebs.<br />

#include<br />

main( )<br />

{<br />

}<br />

{<br />

char c; int nc, nl, nw;<br />

nl = nw = nc = 0;<br />

while ((c = getchar()) != EOF)<br />

}<br />

++nc;<br />

if (c== '\n') ++nl;<br />

if (c == ' ' || c == '\n' || c == '\t') nw++;<br />

printf("nl=%d nw=%d nc=%d ", nl, nw, nc);<br />

return 0;<br />

Sedegi:<br />

abc def bn cde<br />

bnm ghj<br />

^Z<br />

nl=2 nw=6 nc=23<br />

programis cvladebi nc – simboloebis, nw – sityvebis, nl –<br />

striqonebis mTvlelebia. simboluri konstantebi ' ', '\n' da '\t'<br />

aRniSnaven xarvezis, axal striqonze gadasvlisa da tabulaciis<br />

simboloebs Sesabamisad. nc mTvlelis mniSvneloba warmoadgens<br />

inglisuri asoebis (17), xarvezebis (3), tabulaciisa (1) da axal<br />

striqonze gadasvlis (2) simboloTa saerTo raodenobas.<br />

70

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!