CariDotMy

 Forgot password?
 Register

ADVERTISEMENT

Author: juwaini

Mari Bermain Dengan C++

[Copy link]
Post time 8-1-2008 04:26 PM | Show all posts
hai mengkorang...try wat camni pulak...

Reply

Use magic Report


ADVERTISEMENT


Post time 8-1-2008 07:05 PM | Show all posts
  1. #include <iostream.h>


  2. void DisplayDetails(char sDisplayChar, int iToLoop)
  3. {
  4.         for (int j=iToLoop;j>=1;j--)
  5.                cout<<sDisplayChar;
  6.         
  7.         
  8. };

  9. void main()
  10. {
  11.      
  12.         for (int i=0;i<15;i++)
  13.     {    DisplayDetails("I",15-i);
  14.         DisplayDetails(" ",i*2)
  15.         DisplayDetails("I",15-i);
  16.         cout<<endl;
  17.             
  18.     }

  19.         return;
  20. };
Copy the Code
Reply

Use magic Report

Post time 9-1-2008 08:52 AM | Show all posts

Reply #82 stingbeh's post

power rangers...
Reply

Use magic Report

Post time 9-1-2008 10:21 AM | Show all posts

Balas #83 orang_letrik\ catat

tgk rambut la beb.....

Reply

Use magic Report

Post time 9-1-2008 01:44 PM | Show all posts

Reply #84 stingbeh's post

hakhak...
Reply

Use magic Report

 Author| Post time 9-1-2008 03:35 PM | Show all posts


try buat jadual ni plak..
nanti kita pergi kepada program yang susah2 plak..
hangpa dah lawan tokey nampak gayanya...
kalau ada yang tak tau, tanya ye..
Reply

Use magic Report

Follow Us
Post time 9-1-2008 05:09 PM | Show all posts

Reply #86 juwaini's post

macam block cypher je
Reply

Use magic Report

 Author| Post time 9-1-2008 06:00 PM | Show all posts
Originally posted by orang_letrik at 9-1-2008 05:09 PM
macam block cypher je

ni namanya vigenere table..
hint : buat pakai array[26][26]
Reply

Use magic Report


ADVERTISEMENT


 Author| Post time 10-1-2008 07:46 PM | Show all posts
takde ke yang nak mencuba?

hint seterusnya.. kalau nak hasilkan A, dia punya kod dalam c++ adalah (char)65, B = (char)66 dan seterusnya sampai la Z = (char)90..

selamat mencuba..
Reply

Use magic Report

Post time 10-1-2008 07:47 PM | Show all posts
  ohhhhh lagi2.... menarik2
Reply

Use magic Report

 Author| Post time 10-1-2008 07:57 PM | Show all posts
takut ada yang keliru

A = (char)65
B = (char)66
C = (char)67
....
...
..
.

Y = (char)89
Z = (char)90


perlu diingatkan yang dalam c++, huruf besar tak sama dengan huruf kecil, so A is not equal to a.
Reply

Use magic Report

 Author| Post time 11-1-2008 10:07 AM | Show all posts
amacam ni?
takde ke yang nak try?
diam aje semua..
Reply

Use magic Report

Post time 11-1-2008 10:31 AM | Show all posts
Interesting article.....

Professors Slam Java As "Damaging" To Students
http://developers.slashdot.org/developers/08/01/08/0348239.shtml

diaorg prefer student start belajar programming pakai C

[ Last edited by  ultra78 at 11-1-2008 10:32 AM ]
Reply

Use magic Report

 Author| Post time 11-1-2008 10:51 AM | Show all posts
Originally posted by ultra78 at 11-1-2008 10:31 AM
Interesting article.....

Professors Slam Java As "Damaging" To Students
http://developers.slashdot.org/developers/08/01/08/0348239.shtml

diaorg prefer student start belajar programming pakai C

aku pernah dengar satu perumpamaan yang cakap java ni menjadikan orang tak mahir bertambah mahir, tapi orang yang mahir jadi statik dan tak berkembang..

[ Last edited by  juwaini at 11-1-2008 11:50 AM ]
Reply

Use magic Report

Post time 11-1-2008 04:06 PM | Show all posts
Originally posted by i212 at 4-1-2008 04:46 PM
apo kata korang letak code yang leh buat benda seperti dibawah...


*****
****
***
**
*

#include <iostream.h>

void main()
{

cout << "*****\n";
cout << "****\n";
cout << "***\n";
cout <<"**\n";
cout<<"*\n";

}


Reply

Use magic Report

 Author| Post time 11-1-2008 04:39 PM | Show all posts
Originally posted by ultra78 at 11-1-2008 04:06 PM






kejinya ko..
Reply

Use magic Report


ADVERTISEMENT


Post time 11-1-2008 04:57 PM | Show all posts
Originally posted by juwaini at 11-1-2008 04:39 PM


kejinya ko..


sometimes simple solution is the best solution...

[ Last edited by  ultra78 at 11-1-2008 05:02 PM ]
Reply

Use magic Report

 Author| Post time 11-1-2008 06:16 PM | Show all posts
Originally posted by ultra78 at 11-1-2008 04:57 PM


sometimes simple solution is the best solution...

Agak-agak ko camne kalau aku letakkan condition seperti berikut:
1) Anda diwajibkan untuk menggunakan loop for.
2) Program itu membolehkan anda memasukkan bilangan asteriks yang mula-mula ingin dioutputkan.

Agak-agak ko punya 'simplest' solution tu masih boleh digunakan tak?
Reply

Use magic Report

Post time 12-1-2008 06:56 PM | Show all posts
void main()
{
char cAlpha[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

for (int i =0; i<26;i++)
{
      for (int j=0;j<26;j++)
      {
         if (j+i >=26)
           cout<<cAlpha[j+i -25];
        else
           cout<<cAlpha[j+i];
        
      }
       cout<<endl;
}
return;
}
Reply

Use magic Report

 Author| Post time 14-1-2008 01:02 AM | Show all posts
Originally posted by stingbeh at 12-1-2008 06:56 PM
void main()
{
char cAlpha[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

for (int i =0; i

Uhmm.. Good job.. Tapi rasanya kalau ada satu condition ditambah, mungkin ko kena alter secara banyak program ko ni..
Katakan (based on jadual aku sebelum ni), kita nak cari apakah persilangan bagi huruf 'K' dan 'T'. Camne kita nak buat?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

 

ADVERTISEMENT



 

ADVERTISEMENT


 


ADVERTISEMENT
Follow Us

ADVERTISEMENT


Mobile|Archiver|Mobile*default|About Us|CariDotMy

9-1-2025 04:49 AM GMT+8 , Processed in 0.071469 second(s), 27 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

Quick Reply To Top Return to the list