在while循环中设置条件

Nav*_*eva -1 c# while-loop

我有以下C#源代码:

public static bool PeulaRashit()
{
    int days;
    double totalPayForService;

    Console.WriteLine("Enter number of days");
    days = int.Parse(Console.ReadLine()); 
    if (days== 999)
        return false;
    totalPayForService = TotalService(days);
    TotalPyament(totalPayForService, days);
    return true;
}

static void Main(string[] args)
{
    while (.....) //what should I do here?
    {}
}
Run Code Online (Sandbox Code Playgroud)

我想要PeulaRashit重复该方法,直到它false.我的问题是它应该是什么条件while才会发生?

Hos*_*Rad 6

试试这个:

while (PeulaRashit())
{
    //your code
}
Run Code Online (Sandbox Code Playgroud)