| ||||||||||
| 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 | |||||||||
Re:这学期第一道程序,发贴庆祝一下In Reply To:这学期第一道程序,发贴庆祝一下 Posted by:jxd at 2006-09-19 13:56:41 > #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