Advertisement
ahmad_zizo

Relatives

Jul 1st, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. int gcdr( int a, int b )
  2. {
  3. if ( a==0 ) return b;
  4. return gcdr ( b%a, a );
  5. }
  6.  
  7. int main()
  8. {
  9. int n,i,c;
  10. scanf("%d",&n);
  11. while(n)
  12. {
  13. c=1;
  14. for(i=2; i<n; i++)
  15. {
  16. if(gcdr(n,i)==1)
  17. c++;
  18. }
  19. printf("%d\n",c);
  20. scanf("%d",&n);
  21. }
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement