Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. // package md1.java;
  7. import java.util.Scanner;
  8.  
  9. /**
  10. *
  11. * @author Darba Autors
  12. */
  13. public class MD1 {
  14.  
  15. /**
  16. * @param args the command line arguments
  17. */
  18. public static void main(String[] args) {
  19. // TODO code application logic here
  20.  
  21.  
  22. Scanner scan = new Scanner(System.in);
  23.  
  24. int Z = scan.nextInt();
  25. int N = scan.nextInt();
  26.  
  27. // int Z = Integer.parseInt(args[0]);
  28. // int N = Integer.parseInt(args[1]);
  29.  
  30. if(Z>0 && Z<20 && N>0 && N<30){
  31. for (int i=1; i<Z+1; i += 1)
  32. {
  33. for (int k=0; k < (Z-i+N); k++)
  34. {
  35. System.out.print(" ");
  36. }
  37. for (int j=0; j<i; j++)
  38. {
  39. System.out.print("+ ");
  40. }
  41. System.out.println("");
  42. if(i==Z){
  43. System.out.print("1234567890123456789012345678901234567890123456789012345678901234567890");
  44. System.out.println("");
  45. }
  46. }
  47. } else {
  48. System.out.print("DATI NAV KOREKTI!");
  49. }
  50. }
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement