Generation

generate functionTue, 30 May 2023

crear un cajero con todas sus funciones

#include <iostream> using namespace std; int get_money(int amount_withdrawn) { int available_bills[] = {100, 50, 20, 10, 5, 2, 1}; int number_of_bills[7]; for (int i = 0; i < 7; i++) { number_of_bills[i] = amount_withdrawn / available_bills[i]; amount_withdrawn -= number_of_bills[i] * available_bills[i]; } return 0; } int main() { int amount_withdrawn = 0; cout << "Amount to be withdrawn: "; cin >> amount_withdrawn; get_money(amount_withdrawn); return 0; }

Want to kickstart your project?Use the new AI Studio to create your code