saintegg
#include <iostream> int main(){ std::string b = "NO"; int a; for (;;) { std::cin>>a; if (a == 100) break; if (a == 77) b = "YES"; } std::cout<<b;}
0 votes Thanks 0
saintegg
можно, только у тебя будет выводиться 1 в случае - true, 0 - в случае false
int main() { bool b = false; int a = 0; while (1) { std::cin >> a; if (a == 100) break; if (a == 77) b = true; } b ? std::cout << "TRUE" : std::cout << "FALSE"; }
Answers & Comments
int main(){ std::string b = "NO"; int a; for (;;) { std::cin>>a; if (a == 100) break; if (a == 77) b = "YES"; } std::cout<<b;}
int main()
{
bool b = false;
int a = 0;
while (1) {
std::cin >> a;
if (a == 100) break;
if (a == 77) b = true;
}
b ? std::cout << "TRUE" : std::cout << "FALSE";
}