Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (inp == 1) {
- println("you typed 1!");
- } else if (inp == 2) {
- println("you typed 2!");
- } else if (inp == 3) {
- for (i <- 1 to 5) {
- if (i > 3) {
- println(0);
- }
- else println(inp);
- }
- }
- else if (inp == 4) {
- var i = 0;
- while (i < 10) {
- if (i % 2 == 0)
- println(inp);
- else println(0);
- }
- }
- else {
- for (int i = 1; i < 5; ++i) {
- inp match{
- case 1 => println("123123");
- case 7 => println("you typed 7!");
- case _ => println("inp is out of range(1..7)");
- }}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement