sinh hoan vi c 2b 2b

Solutions on MaxInterview for sinh hoan vi c 2b 2b by the best coders in the world

showing results for - "sinh hoan vi c 2b 2b"
Elizabeth
13 Jun 2018
1OK = false ;
2while(!OK) {
3	in();
4	int t = n-1;
5	while(a[t] > a[t+1]) t--;
6	if(t) {
7		int i = n;
8		while(a[i] < a[t]) i--;
9		swap(a[i],a[t]);
10		int l = t+1, r= n;
11		while(l<r) {
12			swap(a[l],a[r]);
13			l++; r--;
14		}
15	} else OK = true;
16}
queries leading to this page
sinh hoan vi c 2b 2bsinh hoan vi c 2b 2b