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

用的进制转换,贴一个了:

Posted by 0810311106 at 2009-08-25 16:35:36 on Problem 2719
#include"stdio.h"
#include"string.h"
int main()
{
	char a[20];
	while(scanf("%s",&a)&&strcmp(a,"0"))
	{
		long b;
		int i,j;
		char c[20];
		strcpy(c,a);
		for(i=0;i<strlen(a);i++)
		if((a[i]-'0')>4)
		a[i]=a[i]-1;
		b=strtol(a,0,9);
		printf("%s: %ld\n",c,b);
	}
	return 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