Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Programming Challenge 1 - Membina Segi Tiga
01-02-2012, 11:26 AM,
Post: #16
RE: Programming Challenge 1 - Membina Segi Tiga
kan syarat dia kau kena send dekat PM. Sad ini kalau masuk pertandingan programming, kau kena keluar daripada bilik game kalau kau tak ikut syarat yang digariskan. Facepalm lepas PM baru aku check. Smile

(01-02-2012, 11:19 AM)c0mrade Wrote: saye super + noob Sad

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv) {

int r, c, t;

printf("Lebar tapak segitiga:");
scanf("%d",&t);

for (r = 1; r <=t; r++) {
for (c = 1; c < t; c++)
printf(" ");

t--;

for (c = 1; c <= 2 * r - 1; c++)
printf("*");

printf("\n");
}

return (EXIT_SUCCESS);
}

Reply
01-02-2012, 11:29 AM,
Post: #17
RE: Programming Challenge 1 - Membina Segi Tiga
(01-02-2012, 11:26 AM)ph33kr1 Wrote: kan syarat dia kau kena send dekat PM. Sad ini kalau masuk pertandingan programming, kau kena keluar daripada bilik game kalau kau tak ikut syarat yang digariskan. Facepalm lepas PM baru aku check. Smile

(01-02-2012, 11:19 AM)c0mrade Wrote: saye super + noob Sad

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv) {

int r, c, t;

printf("Lebar tapak segitiga:");
scanf("%d",&t);

for (r = 1; r <=t; r++) {
for (c = 1; c < t; c++)
printf(" ");

t--;

for (c = 1; c <= 2 * r - 1; c++)
printf("*");

printf("\n");
}

return (EXIT_SUCCESS);
}

oh sory la...sye noob
Reply
01-02-2012, 11:33 AM,
Post: #18
RE: Programming Challenge 1 - Membina Segi Tiga
(01-02-2012, 11:13 AM)johnburn Wrote: [Image: fadhilblackbox_026.png]

[Image: oh.png]

tak menepati soalan, baris ke dua sepatut ada 3 asterisk, tak gitu fikri?
Reply
01-02-2012, 11:36 AM,
Post: #19
RE: Programming Challenge 1 - Membina Segi Tiga
hahaha. tak pe smael. sebab tujuan soalan ni, yang dipentingkan ialah luas tapak tu. itu sahaja. Smile as long luas tapak dia cukup, implementation mcm mana pun tak apa. (untuk chal ini sahaja) Big Grin sbb segitiga basically ada dua cara untuk print pada console. johnburn kasi cara yang satu lagi. sebab tu dia dapat bilangan genap. Smile

(01-02-2012, 11:33 AM)smael Wrote: tak menepati soalan, baris ke dua sepatut ada 3 asterisk, tak gitu fikri?

Reply
01-02-2012, 11:55 AM,
Post: #20
RE: Programming Challenge 1 - Membina Segi Tiga
kalau gitu, jawapan john la best, input dia boleh terima nombor ganjil and genap Smile
Reply
01-02-2012, 12:06 PM, (This post was last modified: 01-02-2012, 12:07 PM by s3m00t.)
Post: #21
RE: Programming Challenge 1 - Membina Segi Tiga
hehehe. kalau diikutkan, macam tu lah. Smile implementation dia pun agak menarik sebenarnya. nanti hujung minggu aku akan kongsi semua PoC yang dah diberi. Big Grin

(01-02-2012, 11:55 AM)smael Wrote: kalau gitu, jawapan john la best, input dia boleh terima nombor ganjil and genap Smile

Reply
01-02-2012, 04:03 PM,
Post: #22
RE: Programming Challenge 1 - Membina Segi Tiga
(01-02-2012, 12:06 PM)ph33kr1 Wrote: hehehe. kalau diikutkan, macam tu lah. Smile implementation dia pun agak menarik sebenarnya. nanti hujung minggu aku akan kongsi semua PoC yang dah diberi. Big Grin

(01-02-2012, 11:55 AM)smael Wrote: kalau gitu, jawapan john la best, input dia boleh terima nombor ganjil and genap Smile

kenape hujung minggu..arini x leh ke??? GayFace
POWERFUL HACKER IS A BRAIN.
Reply
01-02-2012, 04:14 PM,
Post: #23
RE: Programming Challenge 1 - Membina Segi Tiga
sebab aku nak kasi chance dekat adik-adik tbd.my pula untuk cuba selesaikan challenge ni! Big Grin

(01-02-2012, 04:03 PM)th3phantom Wrote: kenape hujung minggu..arini x leh ke??? GayFace

Reply
01-02-2012, 04:16 PM,
Post: #24
RE: Programming Challenge 1 - Membina Segi Tiga
(01-02-2012, 04:14 PM)ph33kr1 Wrote: sebab aku nak kasi chance dekat adik-adik tbd.my pula untuk cuba selesaikan challenge ni! Big Grin

(01-02-2012, 04:03 PM)th3phantom Wrote: kenape hujung minggu..arini x leh ke??? GayFace

adik ke @[adeq] ;d ;d
puas sudah menanam ubi, nenas juga dibeli orang, puas sudah aku berbakti, pengganas juga dipandang orang

Quote:A true warrior need blood on his sword; A true pirate never afraid to sail the red sea.
Reply
01-02-2012, 04:17 PM,
Post: #25
RE: Programming Challenge 1 - Membina Segi Tiga
(01-02-2012, 04:16 PM)Ahlspiess Wrote:
(01-02-2012, 04:14 PM)ph33kr1 Wrote: sebab aku nak kasi chance dekat adik-adik tbd.my pula untuk cuba selesaikan challenge ni! Big Grin

(01-02-2012, 04:03 PM)th3phantom Wrote: kenape hujung minggu..arini x leh ke??? GayFace

adik ke @[adeq] ;d ;d

lol, ;d sungguh ini budak rempah.. ROFL
aku tunggu weekend ni laa.. Big Grin
GayFace -α∂ɛզ_тв∂- GayFace
Reply
01-02-2012, 05:40 PM,
Post: #26
RE: Programming Challenge 1 - Membina Segi Tiga
aku x reti programming GayFace
Lai2 singgah blog saye --> http://keyboardexploit.blogspot.com/

[Image: bibornsignature.png]
Reply
01-02-2012, 08:35 PM,
Post: #27
RE: Programming Challenge 1 - Membina Segi Tiga
disebabkan ruby xtermasuk dlm list language yg diberikan oleh ph33kr1, aku bg la cnth code ruby satu (xlnggar peraturan lg ;d ). logik dia lebih kurang sama ngan yg aku bt code python td gak tp ni pkai for loop dan code python td pkai while (just untk kelainan GayFace )

output:
[Image: fadhilblackbox_027.png]

Code:
#!/usr/bin/env ruby

puts "Lebar tapak: "

a = Integer(gets.chomp)
b = 0

for c in (1..a)
    puts " " * (a-c) + "* " * c
    b+=1
end


@[ph33kr1]
code python td tu actually ko bleh buang je bhgian +(" "*(a-c)) tu sbb tu just masa mula2 aku test untk distinguish padding. xperlu kot padding belah kanan ;d
[̲̅ə̲̅٨̲̅٥̲̅٦̲̅]
i ℓ٥ﻻ ﻉ√٥υ F٥rﻉ√ﻉr ღ
|_|0|_|
|_|_|0|
|0|0|0|
http://jonhburn2.freehostia.com/lol.txt
Reply
01-02-2012, 10:07 PM,
Post: #28
RE: Programming Challenge 1 - Membina Segi Tiga
mane tmpt nk blaja ruby john?
yg ala2 nubs mcm aku sesuai
[Image: 3EsGZgg.png]
uno akhirnya kau ngaku gak ye
Reply
01-02-2012, 10:46 PM,
Post: #29
RE: Programming Challenge 1 - Membina Segi Tiga
x reti lah nak kena elajar dan cuba challenge ni. Smile

(01-02-2012, 05:40 PM)biborn Wrote: aku x reti programming GayFace

ha'a. tak langgar peraturan. LOL! Big Grin anyway, pasal python tu; noted. Smile

(01-02-2012, 08:35 PM)johnburn Wrote: disebabkan ruby xtermasuk dlm list language yg diberikan oleh ph33kr1, aku bg la cnth code ruby satu (xlnggar peraturan lg ;d ). logik dia lebih kurang sama ngan yg aku bt code python td gak tp ni pkai for loop dan code python td pkai while (just untk kelainan GayFace )

output:
[Image: fadhilblackbox_027.png]

Code:
#!/usr/bin/env ruby

puts "Lebar tapak: "

a = Integer(gets.chomp)
b = 0

for c in (1..a)
    puts " " * (a-c) + "* " * c
    b+=1
end


@[ph33kr1]
code python td tu actually ko bleh buang je bhgian +(" "*(a-c)) tu sbb tu just masa mula2 aku test untk distinguish padding. xperlu kot padding belah kanan ;d

Reply
01-02-2012, 11:00 PM,
Post: #30
RE: Programming Challenge 1 - Membina Segi Tiga
ni bley?

[Image: ayam.png]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Challenge - Paan 0b0x3d 7 836 11-12-2013, 02:42 AM
Last Post: JohnWhite
  TBD Challenge #1, Menang RM100 suhz 99 15,014 14-11-2013, 01:43 AM
Last Post: RFC792
  php reverse challenge lvl easy firdaushatta 10 1,009 25-07-2013, 02:18 AM
Last Post: firdaushatta
  [TBD Challenge] Data Forensic v0.0.0.0.0xXXXX1029939392 RFC792 24 2,630 06-07-2013, 07:12 PM
Last Post: RFC792
  Steganography Challenge suhz 35 2,763 04-07-2013, 01:18 PM
Last Post: Codeshift3r
  [TBD Challenge] Log Analysis Challenge #1 ak47suk1 15 1,489 01-07-2013, 11:00 PM
Last Post: shahril
  [PHP] Challenge Reverse This Function ! shahril 12 1,271 26-06-2013, 12:58 PM
Last Post: akif
  Firefly Challenge UnKn0wN 24 2,919 28-10-2012, 09:33 PM
Last Post: shadowmacx
  Wargames2012 Challenge Ahlspiess 26 4,753 21-07-2012, 06:19 PM
Last Post: kryp70
  Pijat challenge #1 pijat 5 1,252 20-06-2012, 11:05 PM
Last Post: kryp70

Forum Jump: