#include using namespace std; int pset,dweset,sto,piecdych,dwiedychy,dycha,piec,dwa,jeden,reszta,x; int main () { cout << "Podaj ile wynosi reszta: "; cin >> reszta; pset=500; dweset=200; sto=100; piecdych=50; dwiedychy=20; dycha=10; piec=5; dwa=2; jeden=1; cout << "Twoja reszta to: "; while (reszta>=pset) { reszta=reszta-pset; cout << "500 "; } while (reszta>=dweset) { reszta=reszta-200; cout << " 200 "; } while (reszta >=sto) { reszta=reszta-100; cout << " 100 "; } while (reszta >= piecdych) { reszta=reszta-50; cout << " 50 "; } while (reszta >=dwiedychy) { reszta=reszta-20; cout << " 20 "; } while (reszta >=dycha) { reszta =reszta-10; cout << " 10 "; } while (reszta>=piec) { reszta=reszta-5; cout << " 5 "; } while (reszta >=dwa) { reszta=reszta-2; cout << " 2 "; } while (reszta >= jeden) { reszta = reszta-1; cout << " 1 "; } }