我正在尝试创建一个贪婪的算法,但我的代码最后不会返回值

-1 c computer-science cs50

#include <stdio.h>
#include <math.h>
#include <cs50.h>

int main(void)
{
    float x;
     printf("O hai! How much change is owed?\n");
    do
    {
        x = GetFloat();
        x = x * 100;
        return roundf(x);
        int c = 0;
        do
        { 
            return x = x - 25;
            return c = c + 1;
        }
        while (x >= 25);
        printf("%d coins\n", c);
    }
    while (x <= 0);
}
Run Code Online (Sandbox Code Playgroud)

当我输入一个像.60这样的浮点数时,它应该将它转换为一个整数然后检测它是否大​​于25.这将是硬币从四分之一到一角硬币减少到镍等的过程中的第一个.但是当我首先尝试在第一个序列完成后打印出我得到的值来测试它,但它没有返回任何内容.

Sco*_*ter 5

只要你的程序点击return roundf(x);它就会停止(因为main已经返回),这就是为什么它读取第一个号码后不产生输出.