Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

大侠们帮忙看看是哪错了?居然WA?疯了……

Posted by Dante at 2005-01-10 19:50:54 on Problem 2105
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator