fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5. int n;
  6. cout<<"enter the number of pieces"<<endl;
  7. cin>>n;
  8. if(n%2==0)
  9. cout<<n<<"YES"<<endl;
  10. else
  11. cout<<n<<"NO"<<endl;
  12. return 0;
  13. }
  14.  
  15.  
  16.  
Success #stdin #stdout 0.01s 5548KB
stdin
#include <iostream>
using namespace std;
int main ()
{
int n;
cout<<"enter the number of pieces"<<endl;
cin>>n;
if(n%2==0)
cout<<n<<"YES"<<endl;
else
cout<<n<<"NO"<<endl;
return 0;
}
  

stdout
enter the number of pieces
0YES