Your SlideShare is downloading. ×
0
Lecture5
Lecture5
Lecture5
Lecture5
Lecture5
Lecture5
Lecture5
Lecture5
Lecture5
Lecture5
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Lecture5

93

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
93
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Àëãîðèòìèéí ¿íäýñ Ëåêö ¹0510/13/12 1
  • 2. Àãóóëãà 1. ͺõöºëò áèø óäèðäëàãà äàìæóóëàõ ¿éëäýë 2. ͺõöºë øàëãàõ ¿éëäýë10/13/12 2
  • 3. ͺõöºëò áèø óäèðäëàãà äàìæóóëàõ ¿éëäýë Àëãîðèòì ººðèéí áè÷ñýí äàðààëëààð áèåëýãäýæ áàéâàë ò¿¿íèéã øóãàìàí àëãîðèòì ãýíý.10/13/12 3
  • 4. Àëãîðèòìä ¿éëäë¿¿äèéí áèåëýãäýõ äàðààëëûã ººð÷èëæ óäèðäàõ ¿éëäýë øààðäëàãàòàé áîëäîã. Èíãýæ ¿éëäë¿¿äèéí áèåëýãäýõ äàðààëëûã ººð÷ëºõ ¿éëäëèéã óäèðäлàãà äàìæóóëàõ ¿éëäýë ãýæ íýðëýíý.10/13/12 4
  • 5. Æèøýý : ýõëýë { float Pi, L, S,V int r; PI:=3.141592 Pi=3.141592; r 1: scanf(“ %d” , & r ); L:=pi*r L=Pi* r; S:=L*r S=L* r; V:=4/3*S*r V=4/3* S* r; L:=2*L L=2* L; goto 1;10/13/12 } 5
  • 6. ͺõöºë øàëãàõ ¿éëäýë Êîìïüþòåðèéí àëãîðèòìä òîäîðõîé íºõöºëèéã øàëãàæ ÿìàð óòãàòàé (1 áà 0) áàéãààãààñ õàìààð÷ áèåëýëòèéã 2 ÿëãààòàé çàìààð ¿ðãýëæë¿¿ëýõ ¿éëäýë øààðäëàãàòàé áàéäàã áºãººä ò¿¿íèéã íºõöºë øàëãàõ ¿éëäýë ãýíý. 1 1 0 íºõöºë íºõöºë íºõöºë 0 0 110/13/12 6
  • 7. Øàëãàõ íºõöºë íü èõýâ÷ëýí E , E , E , E , >F <=F =F =F E , E , (E,F àëãåáðèéí èëýðõèéëýë) õýëáýðòýé >=F <F æèøèõ ¿éëäëýýð þìóó, ýñâýë ëîãèê õýìæèãäýõ¿¿íèéã not, and, or, xor ¿éëäëýýð õîëáîñîí ëîãèêèéí èëýðõèéëýë õýëáýðòýé áàéæ áîëíî.10/13/12 7
  • 8. Æèøýý : { ýõëýë Pi=3.141592; PI:=3.141592 1: scanf(“ %d” , & r ); r if (r<=0) goto 2; L=Pi* r; r>0 S=L* r; ‘òºãñºâ’ L:=pi*r V=4/3* S* r; S:=L*r òºãñ L=2* L; goto 1; V:=4/3*S*r 2: printf(“ End “ ); L:=2*L }10/13/12 8
  • 9. 1. Ñàëààëàõ ¿éëäýë 1 ͺõöºë 0 if ( ͺõöºë ) ¯éëäýë_1; ¿éëäýë_1 ¿éëäýë_2 else ¯éëäýë_2; 2. Àëãàñàõ ¿éëäýë 1 Ýíý íü ñàëààëàõ ¿éëäëèéí ͺõöºë õÿëáàð òîõèîëäîë áºãººä íºõöºë ¿éëäýë_1 áèåëýõã¿é ¿åä ÿìàð íýã ¿éëäýë 0 õèéõã¿é äàðàà÷èéí ¿éëäýëä øèëæèõ øààðäëàãàòàé áîëäîã.10/13/12 9
  • 10. 3. Àëãàñàõ ¿éëäëèéí õóâüä íºõöºë ¿íýí áàéõàä áèåëýõ îëîí ¿éëäýë áè÷èõ øààðäëàãàòàé áîë ò¿¿íèéã äàðààõü õýëáýðòýé áè÷íý. 1 if ( ͺõöºë ) { ͺõöºë ¯éëäýë_1; ¿éëäýë_1 0 . . . . . ¿éëäýë_n . ¯éëäýë_n; }10/13/12 10

×