Created
October 1, 2012 11:22
-
-
Save yrchen/3811053 to your computer and use it in GitHub Desktop.
2012 CE1001 A1-2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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