Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package utils
- /**
- * @author Bunyod Bobojonov (bunyodreal@gmail.com). Created at 6/1/16.
- */
- object Pagination {
- def main(args: Array[String]): Unit = {
- println("Hello World from main function!")
- var evens = ""
- var odds = ""
- val n = 100 // number of pages
- val m = n/2
- for (i <- 1 to m+1) {
- if (i%2 == 0) {
- evens = evens + s"$i,${2*(m-i) + (i+1)}," // TODO remove last pair
- } else {
- odds = odds + s"${2*(m-i) + (i+1)},$i,"
- }
- }
- println(evens)
- println("-----------------------")
- println(odds)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement