-1
I need to make a code to solve the following question: I have a basket with capacity C, I have 3 types of fruit, I will receive the amount one per line, to put all of them in the basket, the collection of these fruits takes 1 minute.
For example:
Basket = 12
A = 4
B = 3
C = 3
Output: 1
Basket = 10
A = 5
B = 5
C = 5
Output = 2 (because it took two trips, ie two minutes.)
How to use for
? I seek the simplest form.
Follow the beginning of my code:
#include <stdio.h>
int main() {
int c = 0, a = 0, b = 0, c = 0, min = 1, sub = 0;
scanf("%d\n%d\n%d\n%d", & c, & a, & b, & c);
int vtl = a + b + c; //valor total das frutas
if (c >= vtl) {
printf("%d\n", min);
} else if (vtl > c) {
for ()
}
}