modified the spaces before braces

This commit is contained in:
Mann Mehta 2020-03-29 17:31:34 +05:30
parent 5b0c634269
commit ea36236554

View File

@ -22,22 +22,22 @@ Hence Implementation in O(sqrt(n)).
*/
int phiFunction (int n ) {
int result = n ;
for ( ll i=2 ; i*i <= n ; i++ ) {
if ( n%i == 0 ) {
while ( n%i == 0 ) {
n /= i ;
int phiFunction(int n) {
int result = n;
for (ll i=2; i*i <= n; i++) {
if (n%i == 0) {
while (n%i == 0) {
n /= i;
}
result -= result/i ;
result -= result/i;
}
}
if ( n > 1 ) result -= result/n ;
return result ;
if (n > 1) result -= result/n;
return result;
}
int main() {
int n ;
cin >> n ;
cout << phiFunction ( n ) << endl ;
int n;
cin >> n;
cout << phiFunction(n) << endl;
}