Skip to content

Instantly share code, notes, and snippets.

@yrchen
Created October 1, 2012 11:22
Show Gist options
  • Save yrchen/3811053 to your computer and use it in GitHub Desktop.
Save yrchen/3811053 to your computer and use it in GitHub Desktop.
2012 CE1001 A1-2
#include <iostream>
using namespace std;
int
main()
{
int number;
cout << "Enter an integer: ";
cin >> number;
cout << "The integer " << number << " is ";
if ( number % 2 == 0 ) //判斷是否為偶數
cout << "even." << endl;
else
cout << "odd." << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment