#include using namespace std; typedef long long ll; int main() { int a[4]; while (1) { a[0]=rand()%10; a[1]=rand()%10; a[2]=rand()%10; a[3]=rand()%10; if (a[0]!=a[1]&&a[0]!=a[2]&&a[0]!=a[3]&&a[1]!=a[2]&&a[1]!=a[3]&&a[2]!=a[3]) { cout<>x>>y; if (x==4) return 0; if (x+y==4) break; } } sort(a,a+4); do { cout<>x>>y; if (x==4) break; } while (next_permutation(a,a+4)); return 0; }