SlideShare a Scribd company logo
ALGORITMI
Preuzeto sa http://www.webnstudy.com
Linijski algoritmi
⚫Linijska algoritamska struktura je ona
kod koje se svaki korak izvršava
tačno jedanput
Za unet poluprečnik r izračunati i ispisati obim i
površinu kruga.
Za unete dužine stranica a i b, izračunati i
ispisati površinu, obim i dijagonalu pravougaonika.
Za uneti celi broj X (traži se da bude X>9), treba
ispisati pretposlednju cifru (npr.: za X=1024, rezultat je 2).
Za uneti celi četvorocifren broj X, treba ispisati drugu
po redu cifru (npr.: za X=1234, rezultat je 2).
Unosi se rezolucija slike u obliku dva cela broja koji označavaju broj
piksela po širini i visini. Izračunati rezoluciju slike u
megapikselima, ako znamo da megapiksel predstavlja milion piksela.
Unosi se broj časova koje učenici imaju tog dana po rasporedu.
Izračunati koliko sati i minuta đaci provedu na nastavi, ako znamo
da čas traje 45 minuta.
Razgranati algoritmi
⚫Razgranata algoritamska struktura je ona
kod koje se svaki korak izvršava
jednom ili nijednom.
Za uneti broj X, proveriti i ispisati da li
je paran ili neparan.
Za unetu godinu proveriti da li je prestupna.
Unose se tri broja A, B i C. Izračunati zbir onih koji su
veći od nule.
Za unete dužine A, B i C, proveriti da li to mogu biti
stranice trougla. Za trougao važi da je zbir dužina svake
dve strane duži od treće.
Za unete brojeve A i B, izračunati vrednost X = min2(A,B) /
max(A,B). Minimum je manji, a maksimum je veći od brojeva koji su
zadati.
Uslovi za zaposlenje u preduzeću "Mlade snage" su da
kandidat bude stariji od 60 godina ili da ima radno
iskustvo od bar 20 godina. U suprotnom će biti
zaposlen samo ako ima prosečnu ocenu sa fakulteta veću
od 8.5. Na početku se unose starost i iskustvo, a tek ako
zatreba, prosečna ocena. Računar treba da napiše poruku
"ZAPOSLITI" ili "ODBITI".
Na pijaci se treba odlučiti za određeni proizvod. Ako je cena 500g
mesa veća od cene 20 komada jaja, a sir jeftiniji od 30 dinara,
uzećemo 15 jaja i 800g sira. Inače, uzećemo samo 400g mesa. Unose
se cene mesa i sira po kilogramu i jaja po komadu, a računar treba da
napiše koliko ćemo ukupno platiti.
Za unetu numeričku ocenu učenika (od 1 do 5), ispisati
njeno značenje (5 - "Odličan", 4 - "Vrlo dobar", 3 -
"Dobar", 2 - "Dovoljan" i 1 - "Nedovoljan").

More Related Content

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
Alireza Esmikhani
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

ALGORITMI.pptx

  • 2. Linijski algoritmi ⚫Linijska algoritamska struktura je ona kod koje se svaki korak izvršava tačno jedanput
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Za unet poluprečnik r izračunati i ispisati obim i površinu kruga.
  • 8. Za unete dužine stranica a i b, izračunati i ispisati površinu, obim i dijagonalu pravougaonika.
  • 9. Za uneti celi broj X (traži se da bude X>9), treba ispisati pretposlednju cifru (npr.: za X=1024, rezultat je 2).
  • 10. Za uneti celi četvorocifren broj X, treba ispisati drugu po redu cifru (npr.: za X=1234, rezultat je 2).
  • 11. Unosi se rezolucija slike u obliku dva cela broja koji označavaju broj piksela po širini i visini. Izračunati rezoluciju slike u megapikselima, ako znamo da megapiksel predstavlja milion piksela.
  • 12. Unosi se broj časova koje učenici imaju tog dana po rasporedu. Izračunati koliko sati i minuta đaci provedu na nastavi, ako znamo da čas traje 45 minuta.
  • 13. Razgranati algoritmi ⚫Razgranata algoritamska struktura je ona kod koje se svaki korak izvršava jednom ili nijednom.
  • 14.
  • 15. Za uneti broj X, proveriti i ispisati da li je paran ili neparan.
  • 16. Za unetu godinu proveriti da li je prestupna.
  • 17. Unose se tri broja A, B i C. Izračunati zbir onih koji su veći od nule.
  • 18. Za unete dužine A, B i C, proveriti da li to mogu biti stranice trougla. Za trougao važi da je zbir dužina svake dve strane duži od treće.
  • 19. Za unete brojeve A i B, izračunati vrednost X = min2(A,B) / max(A,B). Minimum je manji, a maksimum je veći od brojeva koji su zadati.
  • 20. Uslovi za zaposlenje u preduzeću "Mlade snage" su da kandidat bude stariji od 60 godina ili da ima radno iskustvo od bar 20 godina. U suprotnom će biti zaposlen samo ako ima prosečnu ocenu sa fakulteta veću od 8.5. Na početku se unose starost i iskustvo, a tek ako zatreba, prosečna ocena. Računar treba da napiše poruku "ZAPOSLITI" ili "ODBITI".
  • 21. Na pijaci se treba odlučiti za određeni proizvod. Ako je cena 500g mesa veća od cene 20 komada jaja, a sir jeftiniji od 30 dinara, uzećemo 15 jaja i 800g sira. Inače, uzećemo samo 400g mesa. Unose se cene mesa i sira po kilogramu i jaja po komadu, a računar treba da napiše koliko ćemo ukupno platiti.
  • 22.
  • 23. Za unetu numeričku ocenu učenika (od 1 do 5), ispisati njeno značenje (5 - "Odličan", 4 - "Vrlo dobar", 3 - "Dobar", 2 - "Dovoljan" i 1 - "Nedovoljan").