| ||||||||||
| 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 | |||||||||
大侠们帮忙看看是哪错了?居然WA?疯了……#include <stdio.h>
#include <math.h>
#include <malloc.h>
void main (){
int n,m,t,a,*i;
char *ii,enter;
double *o;
scanf("%d",&n);
if (1<=n&&n<=9){
i=(int *)malloc(n*32*sizeof(int));
o=(double *)malloc(n*4*sizeof(double));
ii=(char *)malloc(n*32*sizeof(char));
scanf("%c",&enter);
for (m=0;m<n;m++){
for (t=0;t<32;t++){
scanf("%c",ii+m*32+t);
*(i+m*32+t)=*(ii+m*32+t)-48;
}
scanf("%c",&enter);
for (t=0;t<4;t++){
*(o+m*4+t)=0;
for (a=0;a<8;a++){
*(o+m*4+t)+=*(i+m*32+t*8+a)*pow(2,(7-a))
;}
}
printf ("%.0lf.%.0lf.%.0lf.%.0lf\n",*(o+m*4),*(o+m*4+1),*(o+m*4+2),*(o+m*4+3));
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator