Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * 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 md1.java;
- import java.util.Scanner;
- /**
- *
- * @author Darba Autors
- */
- public class MD1 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // TODO code application logic here
- Scanner scan = new Scanner(System.in);
- int Z = scan.nextInt();
- int N = scan.nextInt();
- // int Z = Integer.parseInt(args[0]);
- // int N = Integer.parseInt(args[1]);
- if(Z>0 && Z<20 && N>0 && N<30){
- for (int i=1; i<Z+1; i += 1)
- {
- for (int k=0; k < (Z-i+N); k++)
- {
- System.out.print(" ");
- }
- for (int j=0; j<i; j++)
- {
- System.out.print("+ ");
- }
- System.out.println("");
- if(i==Z){
- System.out.print("1234567890123456789012345678901234567890123456789012345678901234567890");
- System.out.println("");
- }
- }
- } else {
- System.out.print("DATI NAV KOREKTI!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement