# hdu 2561~2566 水题集合

2561：

``` 1 #include <iostream>
2 #include <cstring>
3 using namespace std;
4
5 const int N = 10;
6 int num[N];
7
8 int main()
9 {
10     int t;
11     cin >> t;
12     while ( t-- )
13     {
14         int n;
15         cin >> n;
16         for ( int i = 0; i < n; i++ )
17         {
18             cin >> num[i];
19         }
20         int tmp = 0;
21         for ( int i = 1; i < n; i++ )
22         {
23             if ( num[tmp] > num[i] ) tmp = i;
24         }
25         num[tmp] = 100;
26         tmp = 0;
27         for ( int i = 1; i < n; i++ )
28         {
29             if ( num[tmp] > num[i] ) tmp = i;
30         }
31         cout << num[tmp] << endl;
32     }
33     return 0;
34 }```

2562：

``` 1 #include <iostream>
2 #include <cstring>
3 using namespace std;
4
5 const int N = 51;
6 char num[N];
7
8 int main()
9 {
10     int t;
11     cin >> t;
12     while ( t-- )
13     {
14         cin >> num;
15         int len = strlen(num);
16         for ( int i = 0; i < len - 1; i += 2 )
17         {
18             swap( num[i], num[i + 1] );
19         }
20         cout << num << endl;
21     }
22     return 0;
23 }```

2563：

2564：

``` 1 #include <cstring>
2 #include <cstdio>
3 #include <cctype>
4 using namespace std;
5
6 const int N = 101;
7 char word[N];
8
9 int main ()
10 {
11     int t;
12     scanf("%d", &t);
13     getchar();
14     while ( t-- )
15     {
16         gets(word);
17         int len = strlen(word);
18         for ( int i = 0; i < len; i++ )
19         {
20             if ( isalpha(word[i]) )
21             {
22                 char ch = toupper(word[i]);
23                 printf("%c", ch);
24                 do
25                 {
26                     i++;
27                 } while ( isalpha(word[i]) );
28             }
29         }
30         puts("");
31     }
32     return 0;
33 }```

2565：

2566：

## HDU 2092 整数解 --- 水题

x+y = n, x*y = m; y = n - x; x * ( n - x) = m nx - x^2 = m; x^2 - nx + m = 0; △ = sqrt(n^2 - 4m) 要有整数解即△需要为可开方数即可. /* HDU 2092 整数解 --- 水题 */ #include <cstdio> #include <cmath> int main() { double n, m; while (scanf("%lf%lf", &n,

## hdu 5210 delete 水题

Delete Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5210 Description wld有n个数(a1,a2,...,an),他希望进行k次删除一个数的操作,使得最后剩下的n−k个数中有最多的不同的数,保证1≤n≤100,0≤k<n,1≤ai≤n(对于任意1≤i≤n) Input 多组数据(最多100组)对于每组数据:第一行:一个数n表示数的个数接下来一行:

## hdu 4802 GPA 水题

GPA Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4802 Description In college, a student may take several courses. for each course i, he earns a certain credit (ci), and a mark ranging from A to F, which is c

## hdu 5495 LCS 水题

LCS Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5495 Description 你有两个序列\{a_1,a_2,...,a_n\}{a?1??,a?2??,...,a?n??}和\{b_1,b_2,...,b_n\}{b?1??,b?2??,...,b?n??}. 他们都是11到nn的一个排列. 你需要找到另一个排列\{p_1,p_2,...,p_n\}{p?1?

## hdu 5326 Work 水题

Work Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 225    Accepted Submission(s): 166 Problem Description It’s an interesting experience to move from ICPC to work, end my college life and star

## hdu 4493 Tutor 水题

Tutor Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4493 Description Lilin was a student of Tonghua Normal University. She is studying at University of Chicago now. Besides studying, she worked as a tutor tea