Exercice en c++

Résolu
scofield.med Messages postés 10 Statut Membre -  
scofield.med Messages postés 10 Statut Membre -
Bonjour,lé programmeur j ai un petit pb
j ai un exercice en language c++ et j arrive po a trouver la solution
voila l'exer
1
12
123
1234
12345
123456
1234567
12345678
123456789
..........
l 'utilisateur donné le nombre de ligne a afficher par ex demande 5 la résultat
1
12
123
1234
12345
Configuration: Windows XP
Firefox 2.0.0.14

3 réponses

  1. Nabla's Messages postés 18201 Date d'inscription   Statut Contributeur Dernière intervention   3 228
     
    void main
    {
    int nb;
    cout<<"lignes"<<endl;
    cin>>nb;

    char* text= new char[nb+1];

    for (int i=0;i<nb;i++)
    {
    text[i]=i+1;
    text[i+1]='0';
    cout<<text<<endl;
    }

    cout<<endl<<"ton prof va tricard que tu l as pas fait toi meme"<<endl;
    }
    1
    1. scofield.med Messages postés 10 Statut Membre
       
      merci bcp man and am sorry pour te dérangement thx
      0
  2. jaouaf_mohamed Messages postés 4 Statut Membre
     
    ---------------------------------------------------------
    # include <stdio.h>

    main ()
    {
    printf ("Donnez le nombre de ligne = ");
    scanf ("%d",&n);

    for (t=1;t<=n;t++)
    {
    for (h=1;h<=t;h++)
    {
    printf ("%d",h);
    }
    printf ("\n");
    }
    getch ();
    }
    -------------------------------------------------------
    0
  3. scofield.med Messages postés 10 Statut Membre
     
    merci bcp c claire thx man
    0