IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Pascal Discussion :

Programme de construction d'une fonction ax2+bx+c


Sujet :

Pascal

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre à l'essai
    Inscrit en
    Novembre 2007
    Messages
    3
    Détails du profil
    Informations forums :
    Inscription : Novembre 2007
    Messages : 3
    Par défaut Programme de construction d'une fonction ax2+bx+c
    bonsoir monsieur je voudrais avoir le programme de construvtion de la fonction ax2+bx+c en pascal et si vous pouvez me montrer comment initialiser le mode graphe de turbo ça m'aiderai beaucoup.merci

  2. #2
    Membre Expert
    Avatar de krachik
    Inscrit en
    Décembre 2004
    Messages
    1 964
    Détails du profil
    Informations forums :
    Inscription : Décembre 2004
    Messages : 1 964
    Par défaut
    Bonjour et Bienvenu!
    Citation Envoyé par sodjinou
    bonsoir monsieur je voudrais avoir le programme de construvtion de la fonction ax2+bx+c en pascal
    Ici personne ne fera ton exercice à ta place si tu veux qu'on t'aide tu nous montre ce que tu as fait ,ce qu'il ne va pas ou là ou tu bloque.(va faire un tour sur

    http://club.developpez.com/regles/
    Commences par etablir un algo et apres essaies de le traduire en Pascal(Apres faut savoir réellement ce que tu veux faire,un programme qui resoud un equation du seond degré?)tres classique ça

    Citation Envoyé par sodjinou
    comment initialiser le mode graphe de turbo ça m'aiderai beaucoup.merci
    voila un lien http://cyberzoide.developpez.com/info/turbo/chap11.php3
    @+

  3. #3
    Inactif
    Inscrit en
    Février 2007
    Messages
    46
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 46
    Par défaut Voici un petit prog. enfin qui peut vous aider!
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    PROGRAM Equation_de_2eme (input,output);
    VAR     A,B,C,D,E,F,G,R,x,x1,x2:real;
    Begin
            writeln('');
    	writeln('       -| La Structure De Cette Equation Est : ( A*(X*X) + B*X + C ) |-');
    	write('   Donnez La valeur de A   ');read(A);
    	write('   Donnez La valeur de B   ');read(B);
            write('   Donnez La valeur de C   ');read(C);
    writeln('');
    	if (A=0) then write('    Pas De Solution !  /   A=0  / ');
            D:=(B*B)-(4*A*C);
    	if (D<0) then write('    Pas De Solution / Delta est Negatif ! / ');
    	E:=2*A;
    	F:=-B;
            R:=sqrt(D);
    	G:=-R;
    	x:=F/E;
    	x1:=F*G/E;
    	x2:=F+R/E;
    	if (D>0) then writeln(' Les Resultats Sont     X1 = ',x1,'     X2 = ',x2) else write(' Le Resultat De X est :   ',x);
    writeln('');
    	writeln('');
    	writeln('       Les different calcules sont :');
    	writeln('       Le Resultat De Delta est           :      ',D);
    	write('       Le Resultat De Racine de Delta est :      ',R);
    end.
    Enfin si vous êtes intéressé sur d'autres exercices voici mes propres codes-sources autant que débutant:
    Attention les fichiers son compressés:
    http://www.geocities.com/bsdocuments...res/debuts.zip
    a+

  4. #4
    Inactif
    Inscrit en
    Février 2007
    Messages
    46
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 46
    Par défaut Résolutions des matrices ? essayer ceci!
    Si vous êtes intréssé aux résolutions des matrices; ce code est bon !
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
     
                                                                                        (*
       ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
       RگALISگ PAR: http://www.net.bsd-fan.com
       POUR       : TP DE MATH ( OPERATIONS SUR LES MATRICES, Addition,
        Multiplication, R‚solution D'Un Systٹme D''گquations )
       DATE       : 11/04/2004, Derniٹre Mise A Jour -> 07/05/2004 /--h--
       ±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±         *)
                            Program math_tp;
    {$R test.res}
    uses crt;
    VAR        m1,m2,m3:array[1..3,1..4] of real;
               a,b,d:integer;dx1,dx2,dx3:real;c:char;
    procedure affsystem;
    begin
             (*                     Affichage                               *)
             gotoxy(62,7);write(' X1');
             gotoxy(58,8);write(' x   X2  =');
             gotoxy(62,9);write(' X3');
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(40+(b*4),6+a);write(m1[a,b]:3:0);delay(70);
             end;b:=4;
             for a:=1 to 3 do begin
             gotoxy(70,6+a);write(m1[a,b]:3:0);delay(70);
             end;delay(500);
    end;
    procedure testretour;
    begin
             repeat
             textcolor(103);textbackground(8);gotoxy(4,24);write('‏ ');
             gotoxy(6,24);textcolor(7);
             write('Autre Op‚ration, Retour Au Menu, Ou Quitter ? [O/R/Q] :');
             textcolor(yellow);
             gotoxy(12,24);write('O');gotoxy(23,24);write('R');gotoxy(42,24);write('Q');
             gotoxy(63,24);write('                                                    ');
             gotoxy(63,24);textcolor(white);textbackground(red);
             gotoxy(63,24);write('   ');gotoxy(64,24);read(c);
             until (c='R')or(c='r')or(c='O')or(c='o')or(c='Q')or(c='q');
    end;
    procedure lecmat1;
    begin
             gotoxy(5,5);write('Remlissage De La 1ٹre Matrice');
             textcolor(103);gotoxy(6,24);write('‏');textcolor(7);gotoxy(8,24);
             write('Veuillez Remplir Les Deux Matrices !');
             for a:=1 to 3 do
             for b:=1 to 3 do begin gotoxy(5+(b*4),8+a);readln(m1[a,b]);end;
    end;
    procedure affmat3;
    begin
             textcolor(white);
             for a:=1 to 3 do
             for b:=1 to 3 do begin gotoxy(50+(b*4),8+a);write(m3[a,b]:3:0);delay(100);end;
    end;
     
    procedure affsys;
    begin
             textcolor(7);
             gotoxy(4,5);write('Le Systٹme D''گquations:');textcolor(yellow);
             gotoxy(4,7);write('(    ) X1+(    ) X2+(    ) X3=');
             gotoxy(4,8);write('(    ) X1+(    ) X2+(    ) X3=');
             gotoxy(4,9);write('(    ) X1+(    ) X2+(    ) X3=');
             textcolor(103);gotoxy(6,24);write('‏');textcolor(7);gotoxy(8,24);
             write('Veuillez Remplir Le Systٹme !');
             for a:=1 to 3 do
             for b:=1 to 4 do begin
             gotoxy(-4+(b*10),6+a);read(m1[a,b]);
             end;
    end;
    procedure enc;
     begin
     (*                          Encadrement                                   *)
     for a:=2 to 23 do begin
     gotoxy(1,a);write('³');delay(5);
     gotoxy(80,a);write('³');delay(5);end;
     for a:=2 to 79 do begin
     gotoxy(a,2);write('ؤ');delay(5);
     gotoxy(a,23);write('ؤ');delay(5);end;
     gotoxy(1,2);write('ع');gotoxy(80,2);write('؟');gotoxy(1,23);write('ہ');gotoxy(80,23);write('ظ');
     (*                 Fin De l'Encadrement                                   *)
     end;
     
    Begin
    c:='o';
    while (c='o') or (c='O') do begin
           (*                        MENU PRINCIPALE                            *)
           textbackground(8);textcolor(7);clrscr;enc;
           gotoxy(5,4);write('OPگRATIONS SUR LES MATRICES');
           gotoxy(5,5);write('MENU PRINCIPALE');delay(100);
           gotoxy(10,10);write('A. Addition De Deux Matrices.');delay(100);
           gotoxy(10,11);write('B. Multiplication De Deux Matrices.');delay(100);
           gotoxy(10,12);write('C. R‚solution D''Un Systٹme D''گquations.');delay(100);
           gotoxy(10,13);write('D. Quitter.');delay(100);
           repeat
          textcolor(103);textbackground(8);gotoxy(4,24);write('‏ ');
          textcolor(7);gotoxy(6,24);
          write('Entrez La Lettre De Votre Choix : ');
          gotoxy(40,24);write('                                                    ');
          gotoxy(40,24);textcolor(white);textbackground(red);
          gotoxy(40,24);write('   ');
          gotoxy(41,24);read(c);
          until (c='A')or(c='a')or(c='B')or(c='b')or(c='C')or(c='c')or(c='D')or(c='d');
            case c of
    'A','a':begin (*            ADDITION DE DEUX MATRICES                    *)
             c:='o';
             while (c='o') or (c='O') do begin
             textbackground(8);textcolor(white);clrscr;enc;
             gotoxy(25,3);write('ADDITION DE DEUX MATRICES');textcolor(7);
             (*            Lecture m1,m2  +  Traitement m1+m2                  *)
             lecmat1;
             gotoxy(21,10);write('+');
             gotoxy(5,18);write('1ٹre Matrice');
             gotoxy(5,5);write('Remlissage De La 2ٹme Matrice');
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(21+(b*4),8+a);readln(m2[a,b]);m3[a,b]:=m2[a,b]+m1[a,b];end;
             gotoxy(38,10);write('=');
             gotoxy(25,18);write('2ٹme Matrice');
             gotoxy(50,5);write('R‚solution De L''Addition');
             (*                        Affichage m3                           *)
             affmat3;textcolor(white);
             gotoxy(50,18);write('R‚sultat De L''Addition');delay(1000);
             testretour;
             end;if (c='R')or(c='r') then c:='O';
        end;
    'B','b':begin (*              MULTIPLICATION DE DEUX MATRICES             *)
             c:='o';
             while (c='o') or (c='O') do begin
             textbackground(8);textcolor(white);clrscr;enc;
             gotoxy(25,3);write('MULTIPLICATION DE DEUX MATRICES');textcolor(7);
             (*                     Lecture m1,m2                             *)
             lecmat1;
             gotoxy(21,10);write('x');
             gotoxy(5,18);write('1ٹre Matrice');
             gotoxy(5,5);write('Remlissage De La 2ٹme Matrice');
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(21+(b*4),8+a);readln(m2[a,b]);
             m3[a,b]:=m2[a,b]*m1[a,b];gotoxy(25,18);end;write('2ٹme Matrice');
             (*                     Traitement m1*m2                          *)
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             m3[a,b]:=0;
             for d:=1 to 3 do m3[a,b]:=m3[a,b]+m1[a,d]*m2[d,b];
                              end;
             textcolor(7);
             gotoxy(38,10);write('=');
             gotoxy(45,5);write('R‚solution De La Multiplication');
             (*                        Affichage m3                           *)
             affmat3;textcolor(white);
             gotoxy(45,18);write('R‚sultat De La Multiplication');delay(1000);
             testretour;
             end;if (c='R')or(c='r') then c:='O';
        end;
    'C','c':begin
             (*          / RگSOLUTION D''UN SYSTشME D''گQUATIONS /            *)
    repeat
           textbackground(8);textcolor(7);clrscr;enc;
           gotoxy(5,4);write('OPگRATIONS SUR LES MATRICES');textcolor(white);
           gotoxy(18,8);write('/ RگSOLUTION D''UN SYSTشME D''گQUATIONS /');delay(100);
           textcolor(7);
           gotoxy(8,12);write('1. R‚solution D''Un Systٹme Avٹc La M‚thode De [GAUSS].');delay(100);
           gotoxy(8,13);write('2. R‚solution D''Un Systٹme Avٹc La M‚thode De [CRAMMER].');delay(100);
           gotoxy(8,14);write('3. R‚solution D''Un Systٹme Avٹc La M‚thode De [INVERSE D''UNE MATRICE].');delay(100);
           gotoxy(8,15);write('4. Retour Au Menu Principale.');delay(100);
           gotoxy(8,16);write('5. Quitter.');delay(100);
           repeat
          textcolor(103);textbackground(8);gotoxy(4,24);write('‏ ');
          textcolor(7);gotoxy(6,24);
          write('Entrez Le Num‚ro De Votre Choix : ');
          gotoxy(40,24);write('                                                    ');
          gotoxy(40,24);textcolor(white);textbackground(red);
          gotoxy(40,24);write('   ');
          gotoxy(41,24);read(c);
          until (c='1')or(c='2')or(c='3')or(c='4')or(c='5');
            case c of
    '4':c:='o';
    '5':c:='n';
    '1':begin (*   RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE GAUSS     *)
            c:='o';
             while (c='o') or (c='O') do begin
             textbackground(8);textcolor(white);clrscr;enc;
             gotoxy(15,3);write('RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE [GAUSS]');
             affsys;
             (*     Test De m1[1,1], m1[2,1], m1[3,1]                           *)
             if (m1[1,1]=0)and(m1[2,1]<>0)
                then begin
             for a:=1 to 3 do
               begin
               m2[1,a]:=m1[1,a];m1[1,a]:=m1[2,a];
               m1[2,a]:=m2[1,a];
               end;
                     end
             else if (m1[1,1]=0)and(m1[2,1]=0)and(m1[3,1]<>0)
                  then begin
             for a:=1 to 3 do
                 begin
             m2[1,a]:=m1[1,a];m1[1,a]:=m1[3,a];
             m1[3,a]:=m2[1,a];
                 end;
                       end;
             (*           ?????????????????????????????????                 *)
             (*                       Delta                                 *)
             m3[1,4]:=m1[2,2]*m1[3,3];m3[1,4]:=m3[1,4]-(m1[2,3]*m1[3,2]);m3[1,4]:=m1[1,1]*m3[1,4];
             m3[1,4]:=m3[1,4]-(m1[1,2]*((m1[2,1]*m1[3,3])-(m1[2,3]*m1[3,1])));
             m3[1,4]:=m3[1,4]+(m1[1,3]*((m1[2,1]*m1[3,2])-(m1[2,2]*m1[3,1])));
             gotoxy(6,11);textcolor(white);write('Delta = [',m3[1,4]:3:0,']');
             textcolor(103);gotoxy(6,20);
             if m3[1,4]=0 then write('Pas De Solution !')
             else begin textcolor(7);
             (*                     Affichage                               *)
             affsystem;
             (*              گlimination de x1 de 2                             *)
             if m1[2,1]=0 then begin
             for a:=2 to 4 do
             m2[3,a]:=m1[2,a];
             end
             else begin
             for a:=1 to 4 do
             m2[1,a]:=(-1*m1[2,1])*m1[1,a];
             for a:=1 to 4 do
             m2[2,a]:=m1[1,1]*m1[2,a];
             for a:=1 to 4 do
             m2[3,a]:=m2[1,a]+m2[2,a];end;
             (*              گlimination de x1 de 3                             *)
             if m1[3,1]=0 then begin
             for a:=2 to 4 do
             m3[3,a]:=m1[3,a];
             end
             else begin
             for a:=1 to 4 do
             m2[1,a]:=(-1*m1[3,1])*m1[1,a];
             for a:=1 to 4 do
             m2[2,a]:=m1[1,1]*m1[3,a];
             for a:=1 to 4 do
             m3[3,a]:=m2[1,a]+m2[2,a];end;
     
             (*                Affichage de 3 PRIME    (SYSTEM 'I' PRIME)       *)
             textcolor(white);gotoxy(8,13);write('/ گlimination de x1 du 2,3 /');
             textcolor(9);
             gotoxy(4,15);write('(    )    (    )    (    )   ');
             gotoxy(4,16);write('          (    )    (    )   ');
             gotoxy(4,17);write('          (    )    (    )   ');
             textcolor(2);
             gotoxy(13,15);write('+');gotoxy(23,15);write('+');gotoxy(33,15);write('=');
             gotoxy(23,16);write('+');gotoxy(33,16);write('=');
             gotoxy(23,17);write('+');gotoxy(33,17);write('=');
             textcolor(white);
             gotoxy(11,15);write('X1');gotoxy(21,15);write('X2');gotoxy(31,15);write('X3');
             gotoxy(21,16);write('X2');gotoxy(31,16);write('X3');
             gotoxy(21,17);write('X2');gotoxy(31,17);write('X3');
             textcolor(11);
             for a:=1 to 3 do begin
             gotoxy(-4+(a*10),15);write(m1[1,a]:3:0);delay(70);end;
             gotoxy(14+(a*7),15);write(m1[1,4]:3:0);delay(70);
             for a:=2 to 3 do begin
             gotoxy(-4+(a*10),16);write(m2[3,a]:3:0);delay(70);end;
             gotoxy(14+(a*7),16);write(m2[3,4]:3:0);delay(70);
             for a:=2 to 3 do begin
             gotoxy(-4+(a*10),17);write(m3[3,a]:3:0);delay(70);end;
             gotoxy(14+(a*7),17);write(m3[3,4]:3:0);delay(70);delay(500);
             (*              گlimination de x2 du 3                             *)
             if (m3[3,2]=0) then begin
             for a:=3 to 4 do
             m3[1,a]:=m1[3,a];
             end
             else begin
             for a:=2 to 4 do
             m2[1,a]:=(-1*m3[3,2])*m2[3,a];
             for a:=2 to 4 do
             m2[2,a]:=m2[3,2]*m3[3,a];
             for a:=2 to 4 do
             m3[1,a]:=m2[1,a]+m2[2,a];
             (*     Affichage de 3 PRIME(2)   (SYSTEM 'I' PRIME(2))             *)
             textcolor(white);gotoxy(50,13);write('/ گlimination de x2 du 3 /');
             textcolor(9);
             gotoxy(43,15);write('(    )    (    )    (    )   ');
             gotoxy(43,16);write('          (    )    (    )   ');
             gotoxy(43,17);write('                    (    )   ');
             textcolor(2);
             gotoxy(52,15);write('+');gotoxy(62,15);write('+');gotoxy(72,15);write('=');
             gotoxy(62,16);write('+');gotoxy(72,16);write('=');
             gotoxy(72,17);write('=');
             textcolor(white);
             gotoxy(50,15);write('X1');gotoxy(60,15);write('X2');gotoxy(70,15);write('X3');
             gotoxy(60,16);write('X2');gotoxy(70,16);write('X3');
             gotoxy(70,17);write('X3');
             textcolor(11);
             for a:=1 to 3 do begin
             gotoxy(35+(a*10),15);write(m1[1,a]:3:0);delay(70);end;
             gotoxy(53+(a*7),15);write(m1[1,4]:3:0);delay(70);
             for a:=2 to 3 do begin
             gotoxy(35+(a*10),16);write(m2[3,a]:3:0);delay(70);end;
             gotoxy(53+(a*7),16);write(m2[3,4]:3:0);delay(70);
             for a:=3 to 3 do begin
             gotoxy(35+(a*10),17);write(m3[1,a]:3:0);delay(70);end;
             gotoxy(53+(a*7),17);write(m3[1,4]:3:0);delay(70);delay(500);
             (*              R‚solution du x1,x2,x3                             *)
             end;
             if (m3[1,3]=0)or(m1[1,1]=0) then begin
             textcolor(103);gotoxy(6,20);write('Systٹme Non R‚solu, Division Par Le Z‚ro !');
             textcolor(white);gotoxy(4,21);write('‏ گvitez De Remplire x1 du 1,2,3 et x2 du 3, Par Le Z‚ro !');
             end
             else begin
     
     (*x3*)  m2[1,1]:=m3[1,4]/m3[1,3];
     (*x2*)  m2[1,2]:=m2[3,4]-(m2[3,3]*m2[1,1]);
     (*x1*)  m3[3,3]:=(m1[1,4]-((m1[1,2]*m2[1,2])+(m1[1,3]*m2[1,1])))/m1[1,1];
             textcolor(white);gotoxy(8,19);write('‏ En Utilisant La M‚thode De [RگTRO GARDE],');
             gotoxy(40,20);write(' On Obtient : ');delay(500);
             gotoxy(60,19);writeln('X1   ',m3[3,3]:3:2);delay(500);
             gotoxy(60,20);writeln('X2   ',m2[1,2]:3:2);delay(500);
             gotoxy(60,21);writeln('X3   ',m2[1,1]:3:2);delay(500);
             textcolor(111);
             gotoxy(63,19);write('=');
             gotoxy(63,20);write('=');
             gotoxy(63,21);write('=');
             end;end;testretour;
             end;if (c='R')or(c='r') then c:='O';
    end;
    '2':begin (*   RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE CRAMMER     *)
             c:='o';
             while (c='o') or (c='O') do begin
             textbackground(8);textcolor(white);clrscr;enc;
             gotoxy(15,3);write('RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE [CRAMMER]');
             affsys;
             (*                       Delta                                 *)
             m3[1,4]:=m1[2,2]*m1[3,3];m3[1,4]:=m3[1,4]-(m1[2,3]*m1[3,2]);m3[1,4]:=m1[1,1]*m3[1,4];
             m3[1,4]:=m3[1,4]-(m1[1,2]*((m1[2,1]*m1[3,3])-(m1[2,3]*m1[3,1])));
             m3[1,4]:=m3[1,4]+(m1[1,3]*((m1[2,1]*m1[3,2])-(m1[2,2]*m1[3,1])));
             gotoxy(6,11);textcolor(white);write('Delta = [',m3[1,4]:3:0,']');
             textcolor(103);gotoxy(6,20);
             if m3[1,4]=0 then write('Pas De Solution !')
             else begin textcolor(7);
             (*                     Affichage                               *)
             affsystem;
             (*                        Affichage                               *)
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(5+(b*4),13+a);write(m1[a,b]:3:0);delay(70);
             end;
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(20+(b*4),13+a);write(m1[a,b]:3:0);delay(70);
             end;
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(35+(b*4),13+a);write(m1[a,b]:3:0);delay(70);
             end;delay(500);b:=4;textcolor(white);
             (*                        DX1,DX2,DX3                             *)
             for a:=1 to 3 do begin
             gotoxy(8,13+a);write('   ');gotoxy(9,13+a);write(m1[a,b]:3:0);delay(70);
             end;
             for a:=1 to 3 do begin
             gotoxy(26+a,13+a);write('   ');gotoxy(28,13+a);write(m1[a,b]:3:0);delay(70);
             end;
             for a:=1 to 3 do begin
             gotoxy(45+a,13+a);write('   ');gotoxy(47,13+a);write(m1[a,b]:3:0);delay(70);
             end;
             gotoxy(9,18);write('Delta X1');
             gotoxy(24,18);write('Delta X2');
             gotoxy(39,18);write('Delta X3');
             (*                           Delta X1                            *)
             dx1:=m1[1,4]*((m1[2,2]*m1[3,3])-(m1[2,3]*m1[3,2]));
             dx1:=dx1 - (m1[1,2]*((m1[2,4]*m1[3,3])-(m1[2,3]*m1[3,4])));
             dx1:=dx1 + (m1[1,3]*((m1[2,4]*m1[3,2])-(m1[2,2]*m1[3,4])));
             gotoxy(6,20);write('Delta X1 = (',dx1:2:2,') => X1 = ');
             dx1:=dx1/m3[1,4];gotoxy(38,20);textcolor(103);write('[       ]');
             textcolor(white);gotoxy(40,20);write(dx1:2:2);delay(700);
             (*                           Delta X2                           *)
             dx2:=m1[1,1]*((m1[2,4]*m1[3,3])-(m1[2,3]*m1[3,4]));
             dx2:=dx2 - (m1[1,4]*((m1[2,1]*m1[3,3])-(m1[2,3]*m1[3,1])));
             dx2:=dx2 + (m1[1,3]*((m1[2,1]*m1[3,4])-(m1[2,4]*m1[3,1])));
             gotoxy(6,21);write('Delta X2 = (',dx2:2:2,') => X2 = ');
             dx2:=dx2/m3[1,4];gotoxy(38,21);textcolor(103);write('[       ]');
             textcolor(white);gotoxy(40,21);write(dx2:2:2);delay(700);
             (*                           Delta X3                           *)
             dx3:=m1[1,1]*((m1[2,2]*m1[3,4])-(m1[2,4]*m1[3,2]));
             dx3:=dx3 - (m1[1,2]*((m1[2,1]*m1[3,4])-(m1[2,4]*m1[3,1])));
             dx3:=dx3 + (m1[1,4]*((m1[2,1]*m1[3,2])-(m1[2,2]*m1[3,1])));
             gotoxy(6,22);write('Delta X3 = (',dx3:2:2,') => X3 = ');
             dx3:=dx3/m3[1,4];gotoxy(38,22);textcolor(103);write('[       ]');
             textcolor(white);gotoxy(40,22);write(dx3:2:2);
             end;testretour;
             end;if (c='R')or(c='r') then c:='O';
        end;
    '3':begin (*   RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE INVERSE     *)
             c:='o';
             while (c='o') or (c='O') do begin
             textbackground(8);textcolor(white);clrscr;enc;
             gotoxy(7,3);write('RگSOLUTION D''UN SYSTشME AVشC LA MگTHODE DE [L''INVشRSE D''UNE MATRICE]');
             affsys;
             (*                       Delta                                 *)
             m3[1,4]:=m1[2,2]*m1[3,3];m3[1,4]:=m3[1,4]-(m1[2,3]*m1[3,2]);m3[1,4]:=m1[1,1]*m3[1,4];
             m3[1,4]:=m3[1,4]-(m1[1,2]*((m1[2,1]*m1[3,3])-(m1[2,3]*m1[3,1])));
             m3[1,4]:=m3[1,4]+(m1[1,3]*((m1[2,1]*m1[3,2])-(m1[2,2]*m1[3,1])));
             dx3:=m3[1,4];
             gotoxy(6,11);textcolor(white);write('Delta = [',m3[1,4]:3:0,']');
             textcolor(103);gotoxy(6,20);
             if m3[1,4]=0 then write('Pas De Solution !')
             else begin textcolor(7);delay(500);
             (*                     Affichage                               *)
             gotoxy(62,7);write(' X1');
             gotoxy(58,8);write(' x   X2   =');
             gotoxy(62,9);write(' X3');
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(40+(b*4),6+a);write(m1[a,b]:3:0);
             delay(70);end;
             textcolor(white);gotoxy(50,11);write('A');textcolor(7);delay(500);
             for a:=1 to 3 do begin
             gotoxy(72,6+a);write(m1[a,b]:3:0);delay(70);
             end;
             textcolor(white);
             gotoxy(74,11);write('B');
             textcolor(7);delay(500);
             (*             INVERSE  AT  +  Affichage                         *)
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             m2[a,b]:=m1[b,a];end;
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(2+(b*4),12+a);write(m2[a,b]:3:0);delay(70);end;
             textcolor(white);gotoxy(7,17);write('A(Transpos‚)');
             textcolor(7);
             delay(500);
             (*                      TRETEMENT                                *)
             m3[1,1]:=       (m2[2,2]*m2[3,3]) - (m2[2,3]*m2[3,2]);
             m3[1,2]:=-1 * ( (m2[2,1]*m2[3,3]) - (m2[2,3]*m2[3,1]) ) ;
             m3[1,3]:=       (m2[2,1]*m2[3,2]) - (m2[2,2]*m2[3,1]);
     
             m3[2,1]:=-1 * ( (m2[1,2]*m2[3,3]) - (m2[1,3]*m2[3,2]) ) ;
             m3[2,2]:=       (m2[1,1]*m2[3,3]) - (m2[1,3]*m2[3,1]);
             m3[2,3]:=-1 * ( (m2[1,1]*m2[3,2]) - (m2[1,2]*m2[3,1]) ) ;
     
             m3[3,1]:=       (m2[1,2]*m2[2,3]) - (m2[1,3]*m2[2,2]);
             m3[3,2]:=-1 * ( (m2[1,1]*m2[2,3]) - (m2[1,3]*m2[2,1]) ) ;
             m3[3,3]:=       (m2[1,1]*m2[2,2]) - (m2[1,2]*m2[2,1]);
     
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(20+(b*4),12+a);write(m3[a,b]:3:0);delay(70);end;
             textcolor(white);gotoxy(25,17);write('A(Adjointe)');
             textcolor(7);delay(500);
             (*                 sauveguarde de m1 [1,2,3 : 4] sur m2         *)
             for a:=1 to 3 do begin
             m2[a,4]:=m1[a,4];
             end;
             (**)
             for a:=1 to 3 do
             for b:=1 to 3 do m1[a,b]:=(1/dx3)*m3[a,b];
     
             for a:=1 to 3 do
             for b:=1 to 3 do begin
             gotoxy(42+(b*7),12+a);write(m1[a,b]:3:2);delay(70);end;
             textcolor(white);gotoxy(42,17);write('A(Inverse) = 1/Delta x A(Adjointe)');
             textcolor(7);delay(500);
     
             for a:=1 to 3 do begin
             m3[1,a]:=0;
             for b:=1 to 3 do begin
             m3[1,a]:=m3[1,a]+(m1[a,b]*m2[b,4]);
             end;end;
             (*                    Affichage                                   *)
             textcolor(111);
             gotoxy(58,19);write('=');
             gotoxy(58,20);write('=');
             gotoxy(58,21);write('=');
             gotoxy(44,20);write('=>');textcolor(white);
             gotoxy(62,19);write('X1');
             gotoxy(62,20);write('X2');
             gotoxy(62,21);write('X3');
             gotoxy(7,20);write('A(Inverse) x A x X = A(Inverse) x B');
             textcolor(7);
             for a:=1 to 3 do begin
             gotoxy(30+(b*7),18+a);write(m3[1,a]:3:2);delay(500);
             end;end;testretour;
             (*                       FIN                                       *)
             end;if (c='R')or(c='r') then c:='O';
        end;
            end;
    until (c='o')or(c='n')or(c='q')or(c='Q');
            end;
    'F','f':c:='n';
           end;
    end;
        textcolor(white);textbackground(black);clrscr;enc;
        gotoxy(10,21);write('http://www.net.bsd-fan.com');
        gotoxy(10,5);write('.FIN DU PROGRAMME RENCONTRگ !');delay(2500);
    end.
    Enfin si vous êtes interessé à mon petit projet à la création des programmes avec du mode OBJET (des programmes interactives) avec
    l'utilisation de la sourie; voici le lien:
    http://www.geocities.com/bsdocuments...es/Doc_UPX.zip
    les unités nécessaires:
    http://www.geocities.com/bsdocuments...s/bsd_unit.zip

    a+

  5. #5
    Membre Expert
    Avatar de krachik
    Inscrit en
    Décembre 2004
    Messages
    1 964
    Détails du profil
    Informations forums :
    Inscription : Décembre 2004
    Messages : 1 964
    Par défaut
    Bonjour
    Ne t'emballes pas trop l'ami si t'a des codes à proposer fais le dans la partie Contribuez
    En ce qui concerne le code sur la resolution de l'equation c'est du code vite fait ou c'est du sérieux?
    la declaration des variables pas tres implicites et comme tu sais que Pascal ne respecte pas la casse et vu comment tu as declarer tes variables (ç'est moins attrayant)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    if (A=0) then write('    Pas De Solution !  /   A=0  / ');
            D:=(B*B)-(4*A*C);
    	if (D<0) then write('    Pas De Solution / Delta est Negatif ! / ');
    Et tu fait(si A=0) et apres tu fais tout les calculs dependant de A sans de te soucier de quoi que ce soit (si a=0 autant ne pas faire d'autre calculs inutiles concernant a pour gagner en temps d'execution,soit on veut coder en dur et on dit on fait rien tant que a=0 pour dire qu'il ne s'agit ppas d'equation du second degré)Un code de ce type peut etre presenté de mille façon mais un seul principe sauf qu'il faut se fixer les regles au depart et s'entendre sur certaines chose
    (juste un truc si a=0 et que b<>0 alor D ne peut etre que positif et le D<0 pas de solutions meme au lycé on parle deja de solution imaginaire dc autant le dire et non dire pas de solution)
    -Pas la peine de faire writeln(''); un writeln; suffira
    En plus tu utilise trop de variables inutiles à mo goût
    mais ce que je ne comprend pas et je voudrais pas etre desagreable mais si t'a mis des codes sources à disposition des gens et des unités c'est que tu as fait pas mal de boulots en pascal mais à voir juste ce code on dirait que tu as presenté un truc vite fait pour faire un test
    Une derniere chose sur le code tu devrais indenté plus souvent tes codes de maniere cohérente et claire comme le dirait quelqu'un
    En ce qui concerne le code sur les matrice premiere chose que je vois
    -code mal indenté
    -pas assez de commentaire
    -pAR CONTRE j'ai executer bravo et chapeau tu t'es donné du mal pour le faire a part les caractére accentué qui apparaisse mal)(bravo)

    Bref je sais qu'il y a d'autres remarques que les autres te feront surement

    Bon courage et bonne continuation
    @+

  6. #6
    Inactif
    Inscrit en
    Février 2007
    Messages
    46
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 46
    Par défaut SALUT!
    vous devez bien lire les messages avant de critiquer!
    et à propos; t'a consulter l'effort eprouvé sur le projet proposé ?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Construction d'une fonction de log d'erreur
    Par vdary dans le forum Programmation système
    Réponses: 0
    Dernier message: 22/09/2012, 17h14
  2. sortir du programme a partir d'une fonction
    Par Torx26 dans le forum Débuter
    Réponses: 27
    Dernier message: 14/01/2012, 08h20
  3. un programme en python appelle une fonction C .. ?
    Par ikuzar dans le forum Débuter
    Réponses: 2
    Dernier message: 02/09/2010, 10h58
  4. Comment programmer la construction d'une requête LINQ ?
    Par SpongeRobert dans le forum Linq
    Réponses: 4
    Dernier message: 01/09/2009, 10h05
  5. Comment arreter un programme a partir d'une fonction?
    Par xslert dans le forum Débuter
    Réponses: 15
    Dernier message: 26/05/2009, 20h14

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo