|
|
back to boardAccepted Posted by ace 20 Oct 2012 11:51 #include<iostream> using namespace std; int GCD( int a, int b ) { a = abs( a ); b = abs( b ); while ( b ) { int tmp = a % b; a = b; b = tmp; } return ( a ); } int main() { int s=0,n,i; cin>>n; for(i=1;i<=n/2;i++) if(GCD(n,i)%n==1) s++; cout<<s; system("pause"); return 0; } Re: Accepted Posted by Ade 20 Oct 2012 19:01 can't believe somebody used system("pause"); Re: Accepted Should'nt this code be deleted by the admins? Edited by author 12.02.2014 02:34 |
|
|