* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates * and open the template in the editor. */ package percobaan; /** * * @author Tri Nugroho */ import java.util.Scanner; public class NewClass { /** * @param args the command line arguments */ public static void main(String[] args) {
int x=1; int i=0; int angka; String hasil="1"; System.out.print("masukan : "); Scanner sken= new Scanner(System.in); int masuk=sken.nextInt(); int masukan=masuk-1; while(i<masukan){ while(x<4){ if(i<masukan){ x++; hasil=hasil+"+"+x; }else{ break; } i++; }