1
2
3
4
5
6
7
8
9
|
> x <- 6
> if (x %% 2 == 0) {
+ print("divisible by 2")
+ } else if (x %% 3 == 0) {
+ print("divisible by 3")
+ } else {
+ print("not divisible by 2 nor by 3...")
+ }
[1] "divisible by 2"
| cs |
댓글 없음:
댓글 쓰기