Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- using namespace std;
- int main()
- {
- srand (time(NULL)) ;
- int t[100];
- int i = 0 ;
- int y = 0 ;
- int seged;
- for (i;i<100;i++){
- t[i] = (rand()%101) ;
- }
- i = 99 ;
- for (i;i > 0;i--){
- for (y;y < i-1;y++ ){
- if(t[y] > t[y+1]){
- seged = t[y];
- t[y]=t[y+1];
- t[y+1] =seged ;
- }
- }
- }
- for (i = 0 ; i < 100;i++ )
- cout << t[i]<<"--";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement