#include<cstdio>
#include<cstring>
#include<math.h>
#include<stdlib.h>
#include<algorithm>
#include<ctime>
#include<iostream>
using namespace std;
const int maxn=1000;
int n,ans;
int gcd(int a,int b)
{
if(a%b==0) return b;
else return gcd(b,a%b);
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("in.txt","r",stdin);
#endif
int i,j;
cin>>n;
ans=0;
for(i=1;i<=n;i++)
if(gcd(n,i)==i)
ans++;
cout<<ans<<endl;
//printf("%.2lf\n",(double)clock()/CLOCKS_PER_SEC);
return 0;
}
/*
*/
noip2012 阅读程序2
最新推荐文章于 2023-06-03 09:00:00 发布
本文深入探讨了C++编程的基础知识与实际应用,通过详细解释C++的关键特性,如类、继承、模板等,帮助读者理解并掌握C++编程的基本原理与技巧。同时,通过实例演示了如何使用C++解决实际问题,包括数据结构、算法实现以及面向对象编程的实践应用。

843

被折叠的 条评论
为什么被折叠?



