jordan787878/lab1
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
first,I declare a variable "n" for input. then, using while loop to set the stop line of this program (if n equals to 1) in the while loop, I declare another variable "a" to decide whether n is an odd number or not,which I determine that a is n%2. (if a=1 then n is an odd number) finally,using if function to decide what algorithm n should do whenever n is larger than 1.