int smallest(int x, int y, int z)
{
int smallest = x;
if (y < smallest)
smallest = y;
if (z < smallest)
smallest = z;
return smallest;
}
void printmessage(int smallest)
{
int w = 0;
if(smallest < 0 || smallest >= 10)
cout << "it is not possible to print the message in this case" << endl;
else
{
for(w < 0 ||w > 10; w < smallest; w++)
cout << "No" << endl;
cout << endl << endl;
}
}
这基本上只是读取 3 个值并找到最小的值。根据最小值打印“否”消息。如果是 5,“否”将被打印 5 次。不知道如何修复我声明最小的部分printmessage
。有人可以帮我解决吗?