题目挺有意思。虽然不是很难。
1 #include2 3 int main() { 4 unsigned int m, n, case_n; 5 unsigned int i, j, k, tmp, one=1; 6 7 scanf("%u", &case_n); 8 9 while (case_n--) {10 scanf("%u %u", &m, &n);11 k = j = 0;12 for (i=1; i<=n; ++i) {13 scanf("%u", &tmp);14 if (tmp && !j)15 j = i;16 }17 if ( (m==n) && (j==0 || j==n) ) {18 printf("0 RMB\n");19 continue;20 }21 if (j && j k) ? tmp:k;30 if (tmp)31 printf("%u0000 RMB\n", tmp);32 else33 printf("0 RMB\n");34 }35 36 return 0;37 }