标签:ring 没有 mission lag break out ace perm sub
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 8893 Accepted Submission(s): 3278
1 #include <iostream> 2 #include <stdio.h> 3 #include <algorithm> 4 #include <string.h> 5 using namespace std; 6 const int N = 5; 7 int a[N]; 8 int main() { 9 int n, m, k = 1, ans; 10 while(cin>>a[0]>>a[1]>>a[2]>>a[3]) { 11 if(a[0] == 0 && a[1] == 0 && a[2] == 0 && a[3] == 0) break; 12 if(k != 1) printf("\n"); 13 int flag = 1, ans; 14 do{ 15 if(a[0] == 0)continue; 16 if(flag) flag = 0; 17 else if(ans == a[0]) printf(" "); 18 else printf("\n"); 19 printf("%d%d%d%d",a[0],a[1],a[2],a[3]); 20 ans = a[0]; 21 }while(next_permutation(a, a+4)); 22 printf("\n"); 23 k++; 24 } 25 return 0; 26 }
标签:ring 没有 mission lag break out ace perm sub
原文地址:http://www.cnblogs.com/xingkongyihao/p/7285899.html