Given an integer N, you have to print the sum of odd numbers and even numbers form 1 to N
Input:
First line consists of T test cases. First line of every test case consists of a Single integer N.Output:
Single line output, with sum of odd numbers and even numbers respectively.Constraints:
1<=T<=1001<=N<=10^5Example:
Input:256Output:9 69 12下面是我的代码实现:注意,这里需要长整形,不然当输入过大时候,就会发生溢出现象。
#includeint main() { int n,i,j;//n组实例 scanf("%d",&n); for(i=0;i
如有问题,请留言。