CodeMan
Home
Uva
AtCoder
Codechef
Codeforce
Hackerrank
LeetCode
Devskill
TopCoder
Spoj
Algorithm
Python3
Hackerearth
Uri
C++
Data Structure
Friday, November 11, 2016
uva 10127 - Ones
#
include
<
bits/stdc++.h
>
using
namespace
std
;
int
main
()
{
int
n,m,c;
while
(
scanf
(
"
%d
"
,&n)==
1
) {
m=c=
1
;
while
(m!=
0
) {
m = m*
10
+
1
;
m%=n;
c++;
}
cout << c << endl;
}
return
0
;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment