Skip to content

Instantly share code, notes, and snippets.

@shohan4556
Created February 7, 2015 18:38
Show Gist options
  • Select an option

  • Save shohan4556/e8b1042cce89b94745d7 to your computer and use it in GitHub Desktop.

Select an option

Save shohan4556/e8b1042cce89b94745d7 to your computer and use it in GitHub Desktop.
/// UVA -10127
// Problem Name : Ones
#include<stdio.h>
int main()
{
int count,t,n;
int g=11;
while(scanf("%d",&n)==1){
t=10;
count=1;
g=1;
while(g%n!=0){
g=(g*t+1)%n;
count++;
}
printf("%d\n",count);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment