#include <iostream>
// **Change needs_it_support so that it returns support:**
bool needs_it_support() {
bool support;
std::cout << "Hello. IT. Have you tried turning it off and on again? Enter 1 for yes, 0 for no.n";
std::cin >> support;
return support;
}
int main() {
// **Change the following line to print the function result:**
needs_it_support(); **calling function**
}
但什么都没有打印出来,我只按了1或0,我没有收到任何回复
您应该在从函数返回后打印结果,在这种情况下,您应该放这样的东西:
std::cout << needs_it_support() << std::endl;
或:
bool result = needs_it_support();
std::cout << result << std::endl;