一位朋友向我展示了这段 c 语言代码,我对它的输出感到非常困惑。谁能解释一下为什么输出“这是一块黑森林蛋糕,这很奇怪”,而不是“这是一块黑森林蛋糕这是一块黑森林蛋糕”?
# include <cstdio>
using namespace std;
int main()
{
float a = 0.5;
if(a < 0.5)
printf("This is Weird");
else
printf("It was a piece of black forest cake");
float b = 0.7;
if(b < 0.7)
printf("This is Weird");
else
printf("It was a piece of black forest cake");
return 0;
}