HDU6124 Euler theorem

来源:互联网 发布:linux arp表老化时间 编辑:程序博客网 时间:2024/05/25 23:56

【题目链接】
http://acm.hdu.edu.cn/showproblem.php?pid=6124

题目意思

告诉你本来想求a mod b,发现b不知道了,问你给定a有多少a mod b不同的结果

解题思路

当b大于a时,mod注定是a本身。当(a-1)/2

代码部分

#include<bits/stdc++.h>using namespace std;int main()   ///不用怀疑就这么短{    int t,a;    scanf("%d",&t);    while (t--)    {        scanf("%d",&a);        printf("%d\n",(a-1)/2+2);    }    return 0;}