Hacer un programa donde a partir de una cantidad de entero positivo mayor a 0 desgloce la cantidad de billetes por denominacion | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Hacer un programa donde a partir de una cantidad de entero positivo mayor a 0 desgloce la cantidad de billetes por denominacion

500 200 100 50 y que sea función con parámetro por referencia que devuelva la cantidad de la denominación y con TOK y strtok

23rd Feb 2017, 1:40 PM
ivan soto chavez
ivan soto chavez - avatar
6 Answers
0
Я так понимаю, нужна программа по расчёту размена?
24th Feb 2017, 10:10 PM
Юрий Исаев
Юрий Исаев - avatar
0
da
24th Feb 2017, 10:11 PM
ivan soto chavez
ivan soto chavez - avatar
0
int sum = 3427; int cash[4] = {500, 200, 100, 50}; for(int i=0; i<4; i++){ int c = sum/cash[i]; if(c){ cout << cash[i] << '=' << c << endl; sum %= cash[i]; } }
24th Feb 2017, 10:20 PM
Юрий Исаев
Юрий Исаев - avatar
0
но мне нужно функции ток
24th Feb 2017, 10:22 PM
ivan soto chavez
ivan soto chavez - avatar
0
Составьте программу, где из числа целое положительное число больше 0 разбив- количество банкнот по номиналу
24th Feb 2017, 10:26 PM
ivan soto chavez
ivan soto chavez - avatar
0
#include <iostream> #include <conio.h> #include <stdlib.h> #include <stdio.h> char *billetes(int cantidad , int a ) char *cantidad int main() { char billetes = "500|200|100|50|20"; char *tok; printf("ingrese cantidad de dinero"); scanf("%i",&cantidad); tok = strtok (billetes, "|"); while (tok != NULL) { printf("%s\n",tok) tok = strtok (NULL); } return 0; }
24th Feb 2017, 10:27 PM
ivan soto chavez
ivan soto chavez - avatar