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.
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言