1 / 1

Vytvořte program pro výčetku platidel. Definujte hodnoty jednotlivých platidel:

Vytvořte program pro výčetku platidel. Definujte hodnoty jednotlivých platidel: int p=12; /* pocet jednotlivych platidel */ int platidla[20] = { 5000 , 2000 , 1000 , 500 , 200 , 100 , 50 , 20 , 10 , 5 , 2 , 1 };

zody
Download Presentation

Vytvořte program pro výčetku platidel. Definujte hodnoty jednotlivých platidel:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Vytvořte program pro výčetku platidel. Definujte hodnoty jednotlivých platidel: int p=12; /* pocetjednotlivych platidel */ intplatidla[20] = {5000 , 2000 , 1000 , 500 , 200 , 100 , 50 , 20 , 10 , 5 , 2 , 1 }; a počet potřebných bankovek a mincí výše uvedených velikostí k vyplacení zadané částky a inicializujte je na nulu: int kusy_platidel[20] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 }; Zadejte hodnotu výplaty - přečtěte ji pomocí printf("požadavkový text") a scanf() . Poté v cyklu od 0 do (počtu platidel) -1 [ ~ indexyjdouodnuly ] zjistěte s využitím celočíselného dělení požadovaný počet jednotlivých bankovek a mincí: kusy_platidel [ i] = plat/platidla[ i ] ; Nakonecvytiskněte v cyklu od 0 do (počtu platidel) –1 počty kusů jednotlivých platidel potřebných pro zadanou částku. Tiskněte jen ty jejichž počet kusů je > 0.

More Related