mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
modified by removing namespace using-directive
This commit is contained in:
parent
ea36236554
commit
022e2f02e7
@ -1,6 +1,5 @@
|
|||||||
#include<bits/stdc++.h>
|
/// C++ Program to find Euler Totient Function
|
||||||
|
#include<iostream>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
@ -22,6 +21,7 @@ Hence Implementation in O(sqrt(n)).
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/// Function to caculate euler totient function
|
||||||
int phiFunction(int n) {
|
int phiFunction(int n) {
|
||||||
int result = n;
|
int result = n;
|
||||||
for (ll i=2; i*i <= n; i++) {
|
for (ll i=2; i*i <= n; i++) {
|
||||||
@ -38,6 +38,6 @@ int phiFunction(int n) {
|
|||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int n;
|
int n;
|
||||||
cin >> n;
|
std::cin >> n;
|
||||||
cout << phiFunction(n) << endl;
|
std::cout << phiFunction(n) << endl;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user