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

这个题用int就够了,可以只保留余数,然后一位一位的往上算的

Posted by Sempr at 2006-04-20 13:53:50 on Problem 2551
In Reply To:INT到用时方恨短,高手指点下迷津呀!!呵呵 Posted by:v123 at 2006-04-20 13:14:53
> #include<iostream>
> #include<string>
> using namespace std;
> void main()
> {
> 	int j,i,n;	
> 	string s="1";		
> 	while(cin>>n)
> 	{
> 		i=atoi(s.substr().c_str());
> 		string s1="1";	
> 		while(i%n!=0)
> 		{
> 			s=s.insert(0,s1);
> 			i=atoi(s.substr().c_str());	 			
> 		}		
> 		j=s.length();
> 		cout<<j<<endl;
> 	}
> }
> 问世间INT为何物?废物呀.怎么就才有10位长呀,郁闷呀,害我不能过啊,高手指点下迷津呀,呵呵谢了啊!!!!!!

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