∂נ ѕσуѕυz
Would you like to react to this message? Create an account in a few clicks or log in to continue.
∂נ ѕσуѕυz

∂נ ѕσуѕυz
 
AnasayfaAnasayfa  KapıKapı  Latest imagesLatest images  AramaArama  Kayıt OlKayıt Ol  Giriş yapGiriş yap  

 

 Pascal, C, C++, QBasic hakkında herşey

Aşağa gitmek 
YazarMesaj
∂נ_ѕσуѕυz
Admin
∂נ_ѕσуѕυz


Mesaj Sayısı : 56
Kayıt tarihi : 03/02/09

Pascal, C, C++, QBasic hakkında herşey Empty
MesajKonu: Pascal, C, C++, QBasic hakkında herşey   Pascal, C, C++, QBasic hakkında herşey EmptyCuma Şub. 06, 2009 5:35 pm

Hehe Bu pascal Üçgenini Matamatikte Bile Kullanıyoruz Ama Değişiği

PASCAL kullanarak pascal üçgenini yaratma programı.

Program PascalTriangle;
uses crt;
{Give your regards to Yaşar Çilek, a wishful thank is enough}
{////////////////////////////////////////}
{This is where factorial is calculated}
function Factorial(n:longint):longint;
var
j,i:longint;
Begin
j:=1;
for i:= 1 to n do
j:=j*i;
Factorial:=j;
End;
{/////////////////////////////////////}

{//////////////////////////////////////////////////////////}
{This is where magic happens, each number on the table is calculated here,
with a little bit of math info you will recognize it}
function DoCombination(r,d:byte):real;
Begin
DoCombination:=Factorial(r)/(Factorial(d)*Factorial(r-d))
End;
{/////////////////////////////////////////////////////////////////////////////}


{This is the main program}
var
r:byte;
d:byte;
Begin
clrscr;
gotoxy(30,10);
textcolor(black);
textbackground(green);
write('Generating Table Now');
gotoxy(30,12);
write('Please Stand By...');
Delay(5000);
textcolor(black);
Textbackground(green);
clrscr;
For r:= 0 to 12 do {Notice that it is only 12 after 12 it just goes crazy}
Begin {Probably it is because of factorial function,but this is a simple program}
for d:=0 to r do
write(DoCombination(r,d):0:0,' ');
delay(200);
Writeln;
End;
textcolor(black+blink);
writeln('Done');
textcolor(black);
textbackground(green);
gotoxy(25,20);
write('Successfully generated 12 rows!!!');
ReadKey;
End.

Pascal, C, C++, QBasic hakkında herşey.__________________
Sayfa başına dön Aşağa gitmek
https://dj-soysuz.yetkin-forum.com
 
Pascal, C, C++, QBasic hakkında herşey
Sayfa başına dön 
1 sayfadaki 1 sayfası

Bu forumun müsaadesi var:Bu forumdaki mesajlara cevap veremezsiniz
∂נ ѕσуѕυz :: ProGLaMa :: MS-DoS ProGLaMa-
Buraya geçin: