Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
大家帮我看看,这样应该也行吧?为什么总是WA?#include <stdio.h> int main() { int N, A[8000], B[8000], i, count; while (scanf("%d", &N) != EOF) { for (A[0] = 0, i = 1; i < N; i++) scanf("%d", &A[i]); count = 1; while (count <= N) for (i = N-1; i >= 0; i--) { if (A[i] == 0) B[i] = count++; A[i]--; } for (i = 0; i < N; i++) printf("%d\n", B[i]); } //system("pause"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator