Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstdlib>
- #include <ctime>
- const int ARRAY_SIZE = 100;
- void printline(int line[ARRAY_SIZE], int linesize) // AFFICHE UNE LIGNE.
- {
- for(int pos=0; pos < linesize; pos++)
- printf("%d ", line[pos]);
- printf("\n");
- }
- int main(void)
- {
- srand(time(NULL));
- int array[ARRAY_SIZE][ARRAY_SIZE];
- for(int row=0; row < ARRAY_SIZE; row++)
- for(int col=0; col < ARRAY_SIZE; col++)
- array[row][col] = rand() % 1000;
- printline(array[rand() % ARRAY_SIZE], ARRAY_SIZE); // affiche une ligne au hasard, en la passant directement __IMPORTANT__
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement