Skip to content

Instantly share code, notes, and snippets.

@salimos
Created October 21, 2013 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salimos/7091740 to your computer and use it in GitHub Desktop.
Save salimos/7091740 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main(){
int a,b,c,d;
a = rand() % 9+1 ;
b = rand() % 10;
c = rand() % 10;
d = rand() % 10;
while(a == b){
b = rand() % 10;
}
while(a == c||b == c){
c = rand() % 10;
}
while(a == d||b == d||c == d){
d = rand() % 10;
}
cout << a << b << c << d;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment