Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int gcdr( int a, int b )
- {
- if ( a==0 ) return b;
- return gcdr ( b%a, a );
- }
- int main()
- {
- int n,i,c;
- scanf("%d",&n);
- while(n)
- {
- c=1;
- for(i=2; i<n; i++)
- {
- if(gcdr(n,i)==1)
- c++;
- }
- printf("%d\n",c);
- scanf("%d",&n);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement