Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dadaproject.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- int num=22;
- System.out.print(num+" ");
- for(int i=1;i<10;i++)
- {
- if((num/10!=0)&&(num/10!=1))
- {
- num=num/2;
- System.out.print(num+" ");
- }
- else {
- num=(num*3)+1;
- System.out.print(num+" ");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment