Code QBasic à convertir Cpp

SneakGuy Messages postés 8 Date d'inscription samedi 29 septembre 2001 Statut Membre Dernière intervention 1 juin 2002 - 29 janv. 2002 à 00:24
stanilou Messages postés 193 Date d'inscription mercredi 5 mai 2004 Statut Membre Dernière intervention 18 novembre 2009 - 30 mars 2005 à 16:31
Salut, j'ai besoin d'aide pour convertir ce code QBasic en Cpp...

*Désoler, tous les signes"plus" sont remplacés par la lettre p. Merci.

CLS
FOR x = 1 TO 12
FOR y = 1 TO 12
FOR z = 1 TO 12
IF (xp7)*(yp5)*(zp3) = 1350 THEN
PRINT x,y,z, "(",CHR$(64px);CHR$(64py);CHR$(64pz);")"
END IF
NEXT
NEXT
NEXT

5 réponses

cs_Jo Messages postés 138 Date d'inscription jeudi 24 août 2000 Statut Membre Dernière intervention 6 avril 2002
29 janv. 2002 à 02:39
Salut,
voila la convertion:

//bon tu fait tous les includes (demande si tu c ps leskels)

int x, y, z;
for(x=1;x<12;x++)
{
for(y=1;y<12;y++)
{
for(z=1;z<12;z++)
{
if(((x+7)*(y+5)*(z+3)) == 1350)
{
cout << x << " ," << y << ", (" << z << ", " << char((64+x) << " " << char(64+y) << " " << char(64+z) << ")";
}
}
}
}

Voila
0
SneakGuy Messages postés 8 Date d'inscription samedi 29 septembre 2001 Statut Membre Dernière intervention 1 juin 2002
29 janv. 2002 à 22:31
Merci beaucoup!!!
0
skysee Messages postés 29 Date d'inscription mercredi 30 janvier 2002 Statut Membre Dernière intervention 28 septembre 2007
2 févr. 2002 à 14:22
salut
essai ca:

void main()
{
int x = 0;
int y = 0;
int z = 0;

for(x = 0; x < 12; x++)
{
for(y = 0; y < 12; y++)
{
for(z = 0; z < 12; z++)
{
if((x + 7) * (y + 5) * (z + 3) == 1350)
{printf("x %d , y %d , z = %d \n",x,y,z);
}
}
}
}
}
0
stanilou Messages postés 193 Date d'inscription mercredi 5 mai 2004 Statut Membre Dernière intervention 18 novembre 2009
23 mars 2005 à 20:51
Ah ah vous êtes trés fort...

Dans le même type:


10
BA = &H3F8 : REM COM1


20 OUT (BA+4),1
: REM DTR ON


30 FOR N =1 TO
10000


40 NEXT N


50 OUT (BA+4),0
:REM DTR OFF


60 FOR N =1 TO
10000


70 NEXT N


80 IF INKEY$ <>
"" THEN END : REM ARRET


90 GOTO 20
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
stanilou Messages postés 193 Date d'inscription mercredi 5 mai 2004 Statut Membre Dernière intervention 18 novembre 2009
30 mars 2005 à 16:31
Personne ne peut m'aider?
0
Rejoignez-nous