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

sdg

Posted by 904013041 at 2005-01-07 20:03:50 on Problem 2105
#include <stdio.h>
#include <string.h>
void main(){
	int n,i,j;
	int a[9][32];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		int h=0,x=0,y=0,z=0,g=0;
	    scanf("%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",&a[i][0],&a[i][1],&a[i][2],&a[i][3],&a[i][4],&a[i][5],&a[i][6],&a[i][7],&a[i][8],&a[i][9],&a[i][10],&a[i][11],&a[i][12],&a[i][13],&a[i][14],&a[i][15],&a[i][16],&a[i][17],&a[i][18],&a[i][19],&a[i][20],&a[i][21],&a[i][22],&a[i][23],&a[i][24],&a[i][25],&a[i][26],&a[i][27],&a[i][28],&a[i][29],&a[i][30],&a[i][31]);
		for(j=0;j<8;j++){
			if(a[i][j]==1){
				for(h=0;h<7-j;h++)
					x=x*2;
			}
		}
		for(j=8;j<16;j++){
			if(a[i][j]==1){
				for(h=0;h<7-j;h++)
					y=y*2;
			}
		}
		for(j=16;j<24;j++){
			if(a[i][j]==1){
				for(h=0;h<7-j;h++)
					z=z*2;
			}
		}
		for(j=24;j<32;j++){
			if(a[i][j]==1){
				for(h=0;h<7-j;h++)
					g=g*2;
			}
		}
		printf("%d.%d.%d.%d\n",x,y,z,g);
	}
}

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