HDU 6124-Euler theorem

来源:互联网 发布:qq三国辅助软件 编辑:程序博客网 时间:2024/05/17 23:00

Euler theorem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)
Total Submission(s): 152    Accepted Submission(s): 128


题目链接:点击打开链接


Problem Description
HazelFan is given two positive integers a,b, and he wants to calculate amodb. But now he forgets the value of b and only remember the value of a, please tell him the number of different possible results.
 

Input
The first line contains a positive integer T(1T5), denoting the number of test cases.
For each test case:
A single line contains a positive integer a(1a109).
 

Output
For each test case:
A single line contains a nonnegative integer, denoting the answer.

Sample Input
2
1
3
 


Sample Output
2
3


题意:有 a 和 b 两个数,让求 a mod b ,但是 b 是不确定的数,让求a mod b 取膜有多少种情况。


分析:打表观察的,哈哈哈哈哈啊哈哈哈哈。。。。。。。





#include <iostream>#include<stdio.h>#include<cmath>using namespace std;int main(){    int a,t;    scanf("%d",&t);    while(t--)    {        scanf("%d",&a);        printf("%d\n",(a+1)/2+1);    }    return 0;}




 
原创粉丝点击