| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
很简单,方法很重要#include<iostream>
#include<cmath>
using namespace std;
int main()
{
unsigned n, a, total;
while(cin>>n)
{
a = total = 1;
a %= n;
while(a)
{
a = a * 10 + 1;
total++;
a %= n;
}
cout<<total<<endl;
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator