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 |
怎么会compile error呢?#include <stdio.h> int mov[9][9]={{1,1,0,1,1,0,0,0,0},{1,1,1,0,0,0,0,0,0},{0,1,1,0,1,1,0,0,0}, {1,0,0,1,0,0,1,0,0},{0,1,0,1,1,1,0,1,0},{0,0,1,0,0,1,0,0,1}, {0,0,0,1,1,0,1,1,0},{0,0,0,0,0,0,1,1,1},{0,0,0,0,1,1,0,1,1}}; int min=28,result[9]={0,0,0,0,0,0,0,0,0}; void main() { int clockTime[9]; for (int i=0;i<9;i++) { scanf("%d",&clockTime[i]); } int moveused[9]; for (moveused[0]=0;moveused[0]<=3;moveused[0]++) { for (moveused[1]=0;moveused[1]<=3;moveused[1]++) { for (moveused[2]=0;moveused[2]<=3;moveused[2]++) { for (moveused[3]=0;moveused[3]<=3;moveused[3]++) { for (moveused[4]=0;moveused[4]<=3;moveused[4]++) { for (moveused[5]=0;moveused[5]<=3;moveused[5]++) { for (moveused[6]=0;moveused[6]<=3;moveused[6]++) { for (moveused[7]=0;moveused[7]<=3;moveused[7]++) { for (moveused[8]=0;moveused[8]<=3;moveused[8]++) { int temp=0; for (int i=0;i<9;i++) //判断是否已拨正 { temp=clockTime[i]; for (int j=8;j>=0;j--) { temp+=moveused[j]*mov[j][i]; } if (temp%4!=0) break; } if (i==9) { int temporory=0; for (int j=0;j<9;j++) { if (moveused[j]!=0) temporory++; } if (temporory<=min) { min=temporory; for (i=0;i<9;i++) result[i]=moveused[i]; } } } } } } } } } } } for (int k=0;k<9;k++) { for (int m=0;m<result[k];m++) { printf("%d ",k+1); } } printf("\n"); } 难道POJ变编译器了? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator