Posted on 2009-06-02 17:12
Hero 阅读(55)
评论(0) 编辑 收藏 引用 所属分类:
代码如诗--ACM
1 //1222 Accepted 0 136 354 C++
2
3 #include <iostream>
4 #include <string>
5 #include <algorithm>
6 using namespace std ;
7
8 const int size = 2000 ;
9
10 int tnum ;
11 int inn ;
12
13 int main()
14 {
15 while( cin >> tnum )
16 {
17 while( tnum -- )
18 {
19 cin >> inn ;
20
21 int x = inn * inn - inn + 1 ;
22 int y = inn * inn + inn - 1 ;
23
24 printf( "%d %d\n", x, y ) ;
25 }
26 }
27
28 return 0 ;
29 }