for (float z = 1.3f; z > -1.2f; z -= 0.1f) { _TCHAR* p = &buffer[sy++][0];
时间: 2024-05-31 18:07:02 浏览: 69
nullptr;
if (z >= 0.0f) {
p = (_TCHAR*)L"positive";
} else {
p = (_TCHAR*)L"negative";
}
wprintf(L"The value of z is %f, which is %s\n", z, p);
}
// Output:
// The value of z is 1.300000, which is positive
// The value of z is 1.200000, which is positive
// The value of z is 1.100000, which is positive
// The value of z is 1.000000, which is positive
// The value of z is 0.900000, which is positive
// The value of z is 0.800000, which is positive
// The value of z is 0.700000, which is positive
// The value of z is 0.600000, which is positive
// The value of z is 0.500000, which is positive
// The value of z is 0.400000, which is positive
// The value of z is 0.300000, which is positive
// The value of z is 0.200000, which is positive
// The value of z is 0.100000, which is positive
// The value of z is -0.000000, which is negative
// The value of z is -0.100000, which is negative
// The value of z is -0.200000, which is negative
// The value of z is -0.300000, which is negative
// The value of z is -0.400000, which is negative
// The value of z is -0.500000, which is negative
// The value of z is -0.600000, which is negative
// The value of z is -0.700000, which is negative
// The value of z is -0.800000, which is negative
// The value of z is -0.900000, which is negative
// The value of z is -1.000000, which is negative
// The value of z is -1.100000, which is negative
// The value of z is -1.200000, which is negative
阅读全文