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 goodluckhym at 2010-04-23 08:05:44 on Problem 2319
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	//freopen("input.txt","r",stdin);
	int f,r,len,temp,i;
	char s,v[5000]={0};
	while(cin>>f) //读第一个数
	{
		s=getchar();//读‘-’符
		cin>>r;    
	    len=(int)log10(double(r-f-1))+1;
		temp=len;
		for(i=0;i<len;i++)
		{
			v[i]=r%10+'0';
			r=r/10;
		}
		cout<<f<<"-";
		for(i=len-1;i>=0;i--)
			cout<<v[i];
		cout<<endl;
	}
	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