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:zhouwenn at 2005-05-12 20:20:39 > #include<stdio.h> > #include<string.h> > int fab(int a,int b,int c,int d,int e,int f,int g,int h){ > return(128*a+64*b+32*c+16*d+8*e+4*f+g*2+h); > } > void main() > {char a[32],k; > int b[32],c,i,n; > scanf("%d",&n); k=getchar(); > while(n--) > { gets(a); > for(i=0;i<32;i++) > {b[i]=a[i]-'0';} > for(i=0;i<4;i++) > {c=fab(b[8*i],b[8*i+1],b[8*i+2],b[8*i+3],b[8*i+4],b[8*i+5],b[8*i+6],b[8*i+7]); > if(i<3) printf("%d.",c); > else printf("%d",c); > } > printf("\n"); > } > } > Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator