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 |
这学期第一道程序,发贴庆祝一下#include"stdio.h" #include"math.h" main() { int i,j,n,ii,jj,k; while(scanf("%d",&n)&&n--!=-1) { for(i=0;i<pow(3,n);i++,printf("\n")) for(j=0;j<pow(3,n);j++) { for(ii=i,jj=j,k=0;k<n&&(ii%3+jj%3)%2==0;ii/=3,jj/=3,k++); printf("%c",32+56*(k==n)); } printf("-\n"); } } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator