Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Trier un tableau avec l’algorithme ‘sort()’

 assert
{filelink=15217}

 
#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;
 
int main() {
  int a[100];
  int i;
 
  for (i = 0; i < 100; ++i)
    a[i] = rand()%100;
 
  sort(&a[0], &a[100]);
 
  for (i = 0; i < 100; ++i)
	cout<<a[i]<<" ";
 
  return 0;
}

No comments yet.

Leave a Comment