daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Jul 11th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. public class TulosteluaLikeABoss {
  3.  
  4.     public static void tulostaTahtia(int maara) {
  5.         // 02-24.1
  6.         while (maara > 0) {
  7.             System.out.print("*");
  8.             maara--;
  9.         }
  10.         System.out.println("");
  11.     }
  12.  
  13.     public static void tulostaTyhjaa(int maara) {
  14.         // 02-24.1
  15.         while (maara > 0) {
  16.             System.out.print(" ");
  17.             maara--;
  18.         }
  19.     }
  20.  
  21.     public static void jouluKuusi(int korkeus) {
  22.         // 02-24.3
  23.         int i = 1;
  24.         while (korkeus > 0) {
  25.             tulostaTyhjaa(korkeus - i);
  26.             tulostaTahtia(i);
  27.             i += 2;
  28.             korkeus--;
  29.         }
  30.         int luku = 2;
  31.         i = 3;
  32.         while (luku > 0) {
  33.             tulostaTyhjaa(korkeus - i);
  34.             tulostaTahtia(i);
  35.             luku--;
  36.         }
  37.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top