language: C++ 4.7.2 (gcc-4.7.2)
date: 773 days 5 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream>
#include <cstdlib>
using namespace std;
 
int main() {
  string str = "abcdef";
  int length = str.length();
  for(int i = 0; i < length; i++)
  {
    int j = i + (rand() % (length-i));
    char c = str[j];
    str[j] = str[i];
    str[i] = c;
  }
  cout << str << endl;
}