Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.lang.*;
- import java.io.*;
- class Tralala {
- public static void main(String[] args){
- int y;
- String text = "";
- for(int x=1; x <= 5; x++){
- if (x <= 4){
- y = x - 1;
- }
- else {
- y = 1;
- }
- System.out.println(x + " : " + y);
- if (y == 0){
- text = "is zero";
- }else if(y == 1){
- text = "one time";
- }else if(y == 2){
- text = "two times";
- }else if(y == 3){
- text = "three times";
- }
- System.out.println("Value" + x + " : " + text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement