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 |
为什么 Output Limit Exceeded,求助,附代码#include<stdio.h> #include<string.h> int jj(int a[]) { return a[0]*128+a[1]*64+a[2]*32+a[3]*16+a[4]*8+a[5]*4+a[6]*2+a[7]*1; } int main() { int n; scanf("%d",&n); int i,t,ii; char c[30]; int d[10]; gets(c); int q,w,e,r; for(ii=0;ii<n;ii++) { gets(c); for(i=0;i<8;i++) { d[i]=c[i]-48; } q=jj(d); for(i=8;i<16;i++) { d[i-8]=c[i]-48; } w=jj(d); for(i=16;i<24;i++) { d[i-16]=c[i]-48; } e=jj(d); for(i=24;i<32;i++) { d[i-24]=c[i]-48; } r=jj(d); printf("%d.%d.%d.%d\r\n",q,w,e,r); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator