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 |
Re:很简单,方法很重要In Reply To:很简单,方法很重要 Posted by:fly_away at 2006-08-05 22:29:10 > #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