School Commit Init

This commit is contained in:
2024-08-31 12:07:21 +03:00
commit 0b130ee18c
2801 changed files with 4720552 additions and 0 deletions
@@ -0,0 +1,15 @@
//Knowing that we have coins of 1, 2 and 5 units, determine the minimum number of coins to pay a given amount.
#include<stdio.h>
int main(){
int n,ones,twos,fives;
printf("Enter a number: ");
scanf("%d",&n);
fives=n/5;
n%=5;
twos=n/2;
n%=2;
ones=n;
printf("The minimum number of coins required are: %d of 5's, %d of 2's and %d of 1's.\n ",fives,twos,ones);
return 0;
}