I have a problem with passing check50 with my greedy. As in title it gives the
expected output, not a prompt for input
error
for every line.
Thanks in advance!
#include <stdio.h>
#include <cs50.h>
#include <math.h>
int main(void)
{
int i;
do{
float change = GetFloat();
i= round(change*100);
}while(i<=0);
int h=0;
do{
//0.25
if(i >= 25){
i=i-25;
}
//0.10
else if(i>= 10 && i <25){
i=i-10;
}
//0.05
else if(i>4&&i<10){
i=i-5;
}
//0.01
else{
i=i-1;
}
h++;
}while(i>0);
printf("%d\n", h);
return 0;
}