Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 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.  
  7. package helloworld;
  8. import java.util.Scanner;
  9. /**
  10.  *
  11.  * @author local
  12.  */
  13. public class HelloWorld {
  14.    
  15.     public void wczytajLiczbeZKlawiatury() {
  16.             Scanner input = new Scanner(System.in);
  17.             String text = input.nextLine();
  18.  
  19.         }
  20.    
  21.     public void wypelnijTablice() {
  22.             int[]tab = new int[10];
  23.             for (int i=0; i<10; i++){
  24.                 tab[i]= i+2;
  25.                 System.out.println(tab[i]);
  26.             }
  27.     }
  28.    
  29.     public void wypiszTabliceOdKonca() {
  30.             int[]tab2 = new int[10];
  31.             for (int i=0; i<10; i++){
  32.                 tab2[i]= i+2;
  33.             }
  34.             for (int i=9; i>=0; i--){
  35.                 System.out.println(tab2[i]);
  36.             }
  37.     }
  38.  
  39.     public static void main(String[] args) {
  40.         // TODO code application logic here
  41.         System.out.println("Hello World");
  42.      
  43.         HelloWorld h = new HelloWorld();
  44.         h.wczytajLiczbeZKlawiatury();
  45.         System.out.println("\n");
  46.         h.wypelnijTablice();
  47.         System.out.println("\n");
  48.         h.wypiszTabliceOdKonca();
  49.     }
  50.    
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement