[ASK] Segitiga pascal

Discussion in 'Programming' started by giovani, Aug 23, 2015.

  1. giovani

    giovani Member

    Joined:
    Apr 29, 2015
    Messages:
    345
    Likes Received:
    10
    Trophy Points:
    18
    ada yang bisa bantu ???
    [​IMG]
     
  2. DwiKhasbullah

    DwiKhasbullah Well-Known Member

    Joined:
    Aug 7, 2014
    Messages:
    1,943
    Likes Received:
    138
    Trophy Points:
    63
    Google+:
    Wah kurang faham gan, dan jangan lupa kalau bikin trend sempatkan menulis kronologi serta alasan dan penjelasan seputar pertanyaan yang agan maksudkan, agar lebih baik lagi nantinya untuk menjaga kebaikan bersoasial juga, kalau tentang pertanyaan mohon di depan judul dikasih ASK.
     
    Ardilas likes this.
  3. Ardilas

    Ardilas Super Level

    Joined:
    Feb 18, 2013
    Messages:
    4,245
    Likes Received:
    317
    Trophy Points:
    83
    Google+:
    Apa yang ditanyakan?
     
  4. giovani

    giovani Member

    Joined:
    Apr 29, 2015
    Messages:
    345
    Likes Received:
    10
    Trophy Points:
    18
    ow iya ketinggalan..
    jadi itu gimana cara membuat segitiga pascal,, itu masih salah..
     
    Last edited: Aug 24, 2015
  5. giovani

    giovani Member

    Joined:
    Apr 29, 2015
    Messages:
    345
    Likes Received:
    10
    Trophy Points:
    18
    ini jadi seperti ini
    [​IMG]
     
  6. AquariuZ

    AquariuZ Active Member

    Joined:
    Apr 16, 2015
    Messages:
    1,006
    Likes Received:
    88
    Trophy Points:
    48
    public static void main(String[] args) {
    int a,x,y;
    Scanner input = new Scanner(System.in);

    System.out.print("Masukan tinggi segitiga : ");
    a = input.nextInt();
    int[][]b = new int[100][100];
    for(x=1; x<=a; x=x+1){
    for(y=a; y>x; y=y-1){
    System.out.print(" ");
    }
    for(y=1; y<=x; y++){
    if(x==0||y==x){
    b[x][y]=1;
    System.out.print(" "+b[x][y]+" ");
    }
    else{
    b[x][y] = b[x-1][y-1] + b[x-1][y];
    if(b[x][y]>99)
    System.out.print(" "+b[x][y]+" ");
    else if(b[x][y]>9)
    System.out.print(" "+b[x][y]+" ");
    else
    System.out.print(" "+b[x][y]+" ");
    }
    }
    System.out.println();
    }
    }
     
  7. giovani

    giovani Member

    Joined:
    Apr 29, 2015
    Messages:
    345
    Likes Received:
    10
    Trophy Points:
    18
    udah kok mas heheh tinggal bilangan vampire ini
     
  8. AquariuZ

    AquariuZ Active Member

    Joined:
    Apr 16, 2015
    Messages:
    1,006
    Likes Received:
    88
    Trophy Points:
    48
  9. giovani

    giovani Member

    Joined:
    Apr 29, 2015
    Messages:
    345
    Likes Received:
    10
    Trophy Points:
    18
    iya mas,, susah banget bilangan vampire
     
  10. AquariuZ

    AquariuZ Active Member

    Joined:
    Apr 16, 2015
    Messages:
    1,006
    Likes Received:
    88
    Trophy Points:
    48
  11. giovani

    giovani Member

    Joined:
    Apr 29, 2015
    Messages:
    345
    Likes Received:
    10
    Trophy Points:
    18
    Sebagai contoh:
    1827 dapat ditulis sebagai hasil kali dari dua angka 21 dan 87.
    yaitu, 1827 = 21 * 87
    Angka berikut 1,8, 2,7 diulang pada hasil kali dua bilangan itu tetapi dalam urutan yang berbeda. 21 dan 87 disebut fangs.

    Bilangan Vampire dapat ditulis dengan 2 fangs, yang memiliki angka yang sama dari digit dengan syarat keduanya tidak berakhir pada bilangan nol.

    Sebagai contoh:

    1260 adalah bilangan vampire, dengan 21 dan 60 sebagai fangs. Kita tahu bahwa 21 × 60 = 1260, namun 126000 bukanlah hasil kali dari 210 × 600, karena keduanya 210 dan 600 memiliki tambahan nol.

    Semua bilangan vampire jelas harus tidak memiliki satu digit.

    Beberapa bilangan vampire:
    117067 = 167 * 701
    124483 = 281 * 443
    536.539 = 563 * 953
    23287176 = 2673 * 8712.

    Bilangan vampire memiliki dua pasang fangs yang berbeda:

    125460 = 204 * 615 = 246 * 510

    Bilangan vampire memiliki tiga pasang fangs yang berbeda:

    13078260 = 1620 * 8073 = 1863 * 7020 = 2070 * 6318
     
  12. giovani

    giovani Member

    Joined:
    Apr 29, 2015
    Messages:
    345
    Likes Received:
    10
    Trophy Points:
    18
    [​IMG]
    ini ada contoh dari bilangan vampire... hwhwhw
     
Loading...

Share This Page