0_0_33827373_6549.cpp: In function 'int main()': 0_0_33827373_6549.cpp:58:16: error: 'flag' was not declared in this scope printf(flag == YES ? "YES\n" : "NO\n"); ^