标签:hspa algo elf list -- iostream sign algorithm row
直接打表找规律
InputThe first line contains a positive integer T(1≤T≤5)T(1≤T≤5), denoting the number of test cases.
For each test case:
A single line contains a positive integer a(1≤a≤109)a(1≤a≤109).OutputFor each test case:
A single line contains a nonnegative integer, denoting the answer.
Sample Input
2 1 3
Sample Output
2 3
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<sstream> #include<algorithm> #include<queue> #include<deque> #include<iomanip> #include<vector> #include<cmath> #include<map> #include<stack> #include<set> #include<memory> #include<list> #include<string> using namespace std; typedef long long LL; typedef unsigned long long ULL; #define MAXN 1009 #define L 31 #define INF 1000000009 #define eps 0.00000001 LL n; int main() { int T; scanf("%d", &T); while (T--) { scanf("%lld", &n); if (n & 1) n++; printf("%lld\n", n / 2 + 1); } }
标签:hspa algo elf list -- iostream sign algorithm row
原文地址:http://www.cnblogs.com/joeylee97/p/7395316.html