Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Exemple d’initialisation d’un tableau multidimensionnel: à revoir


{filelink=16228}

 
#include <iostream>
#include <iomanip>
using namespace std;
char representative[2][20] = {"abcdefghijklmnop",
                              "qrstuvwxyz"};
int articleCount[2][5] = { { 120, 151, 130, 117, 144},
                            {150, 120, 190, 110, 188}
                          };
int main()
{
   for( int i=0; i < 2; i++ )
   {
      cout <<"Representative:  " << representative[i];
      cout << "Number of items sold: ";
      for( int j = 0; j < 5; j++ )
         cout << setw(6) << articleCount[i][j];
      cout << endl;
   }
    return 0;
}

No comments yet.

Leave a Comment