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

为何一样的东西运行4次的结果会不一样?

Posted by laihang at 2004-12-25 01:49:27 on Problem 2105
#include <stdio.h>
void main (){
	int i=1,n,a,j;
	char b[32];
	scanf ("%d",&n);
	for (j=0;j<=31;j++)
	     scanf ("%c",&b[j]);
	while (i<=n){
		a=0;
		a=128*(b[0]-48)+64*(b[1]-48)+32*(b[2]-48)+16*(b[3]-48)+8*(b[4]-48)+4*(b[5])+2*(b[6]-48)+b[7]-48;
		printf ("%d.",a);
        a=0;
		a=128*(b[8]-48)+64*(b[9]-48)+32*(b[10]-48)+16*(b[11]-48)+8*(b[12]-48)+4*(b[13])+2*(b[14]-48)+b[15]-48;
		printf ("%d.",a);
		a=0;
		a=128*(b[16]-48)+64*(b[17]-48)+32*(b[18]-48)+16*(b[19]-48)+8*(b[20]-48)+4*(b[21])+2*(b[22]-48)+b[23]-48;
		printf ("%d.",a);
		a=0;
        a=128*(b[24]-48)+64*(b[25]-48)+32*(b[26]-48)+16*(b[27]-48)+8*(b[28]-48)+4*(b[29]-48)+2*(b[30]-48)+b[31]-48;
		printf ("%d",a);
        printf ("\n");
		i++;
	    for (j=0;j<=31;j++)
	         scanf ("%d",&b[j]);
	}
}
输32个0结果是-4672.192.192.0
		

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