ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1259. How to Become Star?

Accepted
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
Posted by Spatarel Dan Constantin 12 Feb 2014 02:34
Should'nt this code be deleted by the admins?

Edited by author 12.02.2014 02:34