fork download
  1. // // your code goes heremport java.util.*;
  2. // public class Main
  3. // {
  4. // public void pattern(int n){
  5. // int i , j;
  6. // Scanner sc = new Scanner(System.in);
  7. // int n = sc.nextln();
  8. // System.out.print("Enter the value of n :");
  9. // }
  10. let n = 3;
  11. for(i=1; i<=n; i++){
  12. console.log(i+"");
  13. for(j=1; j<=n+1; j++){
  14. console.log(j +"*");
  15. }
  16. if (n===0 || n===0 || n%2===0){
  17. console.log("Error");
  18. }
  19. else{
  20. console.log(i +"");
  21. }
  22. }
  23. console.log("");
  24. // }
  25. // public static void main(String[] args) {
  26. // System.out.println("Hello World");
  27. // Scanner sc = new Scanner(System.in);
  28. // int n = sc.nextln();
  29. // System.out.print("Enter the value of n :");
  30. // }
  31. // }
Success #stdin #stdout 0.05s 16836KB
stdin
Standard input is empty
stdout
1
1*
2*
3*
4*
1
2
1*
2*
3*
4*
2
3
1*
2*
3*
4*
3