2012年3月24日 星期六

23/3/2012 課節二


教學進度:

1. Logical operator
2. While loop (notes)
3. For loop (notes)

課後習題:

Basic questions (all students are required to do the questions below)

1. Summation
Input
An integer N. (0<N<=1000)
Output
Output the value of the expression: 1+2+3+...+n in one line.

2. Factor
Input
An integer N. (0<N<=1000)
Output
Output all the factors of N (including 1 and N) in one line.

Advanced questions (students can choose to do the following questions)

1. Perfect number

Input
An integer N. (0<N<=1000)
Output
Output "Y" if N is a perfect number. Otherwise, output "N".
A perfect number is a number that equal to the sum of its factors(excluding itself).

Try to solve the questions with the fastest way!


If you have any questions, please feel free to contact me here or on the Facebook.

2012年3月21日 星期三

21/3/2012 課節一

教學進度:

1. Introduction to C++ (notes)
2. Basic input/output
3. Arithmetic operators
4. Assignment operators
5. Simple conditional statement (if...else...)

課後習題:

1. Data Process
Input
Five positive integers, which are smaller than 10000000000.
Output
The maximum integer, the minimum integer and the average value(in integer).

2. Leap Year
Input
A integer Y which represent the year. (0<Y<10000)
Output
Output "leap" in a line if Y is a leap year. Otherwise, output "No" in a line.

If you have any questions, please feel free to contact me here or on the Facebook.