April 2022 1 12 Report
Zmodyfikować kod programu tak, aby wyświetlał tylko informacje o nominałach do zwrotu
(dla liczba5 > 0, liczba2 > 0 i reszta > 0).

#include
#include
using namespace std;
int reszta;
int liczba1 = 0;
int liczba2 = 0;
int liczba5 = 0;
int main() {
cout << "Podaj kwotę do wydania: ";
cin >> reszta;
liczba5 = reszta/5;
reszta = reszta - liczba5 * 5;liczba2 = reszta/2;
reszta = reszta - liczba2 * 2;
cout << endl;
cout << "Należy wydac: " << endl;
cout << liczba5 << " szt. pięciozłotówek," << endl;
cout << liczba2 << " szt. dwuzłotówek," << endl;
cout << reszta << " szt. jednozłotówek." << endl;
return 0;
}

Recommend Questions



Life Enjoy

" Life is not a problem to be solved but a reality to be experienced! "

Get in touch

Social

© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.