Question sur Delphi

Tout ce qui ne mérite pas d'être entendu mais qui doit être dit.

Moderators: Mod, Mod, Mod

Question sur Delphi

Postby jak » Thu Jul 31, 2008 11:00 pm

Bonjour,

Comme il n' existe pas de section Delphi dans la section programmation je prend l' initiative de poster ici!

Donc, je cherche un moyen de faire ce type de boucle (ici en C) en Delphi:

[code:1:c2c4ce94c6]while (truc !=0)

{
mes operations
}
[/code:1:c2c4ce94c6]

Car je n' ai pas trouvé d' operateur similaire à "!=" en delphi
:(



Merci d' avance :wink:
User avatar
jak
Projets
 
Posts: 162
Joined: Sun Dec 30, 2007 1:16 pm

Postby Manu404 » Thu Jul 31, 2008 11:12 pm

[code:1:0faa25dd5f]while (truc <> 0)

{
mes operations
} [/code:1:0faa25dd5f]

Voila jak, le booléens pour "différent de".
User avatar
Manu404
 
Posts: 2219
Joined: Tue Feb 26, 2008 3:44 pm
Location: ::1:

Postby jak » Fri Aug 01, 2008 11:17 am

Merci beaucoup :D
User avatar
jak
Projets
 
Posts: 162
Joined: Sun Dec 30, 2007 1:16 pm

Postby Manu404 » Fri Aug 01, 2008 11:36 am

De rien ^^
Voila la liste de tout les booléens delphi[ur=http://www.delphifr.com/tutoriaux/BASES-BOOLEENS-TABLE-VERITES-SYNTAXE-DELPHI_366.aspxl]ici[/url]
User avatar
Manu404
 
Posts: 2219
Joined: Tue Feb 26, 2008 3:44 pm
Location: ::1:

Postby jak » Fri Aug 01, 2008 12:30 pm

Merci manu, tes reponses m' ont permis de réaliser un portage de mon calculateur de PGCD du C vers Delphi

mon dossier projet delphi:

[url]http://www.megaupload.com/fr/?d=VMG4HWYU[/url]

mon main.c pour le projet en C:

[code:1:0df0f4d756]#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])

{

int reste;
int nombreA, nombreB, grand, petit;
reste= 1;

printf("PGCD Calculator\n\n");
printf("nombre A (le plus grand):");
scanf("%ld",&nombreA);
printf("nombre B (le plus petit):");
scanf("%ld",&nombreB);

grand=nombreA;
petit=nombreB;

while (reste!= 0)

{
reste=grand%petit ;

grand=petit;

petit=reste;

}

printf("Le PGCD de %ld et %ld est %ld\n\n",nombreA ,nombreB ,grand);

system("PAUSE");
return 0;

}[/code:1:0df0f4d756]
User avatar
jak
Projets
 
Posts: 162
Joined: Sun Dec 30, 2007 1:16 pm


Return to Le Bar

Who is online

Users browsing this forum: No registered users and 3 guests

cron