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 |
论学好线代的重要性QWQ#include <stdio.h> #include <stdlib.h> #include <string.h> const int shift[9][9]= { {3,2,3,2,2,1,3,1,0}, {3,3,3,3,3,3,2,0,2}, {3,2,3,1,2,2,0,1,3}, {3,3,2,3,3,0,3,3,2}, {3,2,3,2,1,2,3,2,3}, {2,3,3,0,3,3,2,3,3}, {3,1,0,2,2,1,3,2,3}, {2,0,2,3,3,3,3,3,3}, {0,1,3,1,2,2,3,2,3} }; int main(void) { int in[9],ans[9]={0}; int i,j; for(i=0;i<9;i++) { scanf("%d",&in[i]); in[i]=(4-in[i])%4; } for(i=0;i<9;i++) for(j=0;j<9;j++) ans[i]+=shift[i][j]*in[j]; for(i=0;i<9;i++) for(j=0;j<ans[i]%4;j++) printf("%d ",i+1); printf("\n"); return (0); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator