1 solutions
-
0
C :
#include <stdio.h> main(){ int n,rem,digs; while (1 == scanf("%d",&n)) { for (rem=digs=1;rem;digs++) rem = (rem*10+1) % n; printf("%d\n",digs); } }C++ :
#include <stdio.h> main(){ int n,rem,digs; while (1 == scanf("%d",&n)) { for (rem=digs=1;rem;digs++) rem = (rem*10+1) % n; printf("%d\n",digs); } }
- 1
Information
- ID
- 18677
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By