Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int gcd(int a, int b) {
- if (b == 0)
- return a;
- return gcd(b, a % b);
- }
- int main() {
- int counter = 1, a, b, temp, k = 0, kek = 0,sas;
- cin >> a;
- k = a - 1;
- while (k != 0) {
- if (gcd(k, a) == 1) {
- cout << k << endl;
- }
- k--;
- }
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment