# 写在前边

B和D是本次比赛的签到题。CFGJ是中等难度的题。AEHI难度较高的题目。

## D - Welcome

Description

Input

Output

AC代码：

#include<stdio.h>
int main()
{
printf ("Welcome to HRBU College of Information Engineering\n");
}


## B - 悲催的小明

Description

Input

Output

AC代码：

#include<stdio.h>
int main()
{
printf ("2019年01月31日\n");
}


## C - 时制转换

Description

Input

Output

Sample Input
21:11

Sample Output
9:11 PM

AC代码：

#include<stdio.h>
int main()
{
int a, b;
scanf ("%d:%d", &a, &b);
if (a == 12)
printf ("12:%d PM\n", b);
else if (a > 12 && a < 24)
printf ("%d:%d PM\n", a - 12, b);
else if(a == 24)
printf ("0:%d AM\n", b);
else
printf ("%d:%d AM\n", a, b);
}


## F - 三天打鱼两天晒网

Description

Input

Output

Sample Input
103

Sample Output
Fishing in day 103

Sample Input 2
34

Sample Output 2
Drying in day 34

AC代码：

#include<stdio.h>
int main()
{
int n;
scanf ("%d", &n);
if (n % 5 == 1 || n % 5 == 2 || n % 5 == 3)
printf ("Fishing in day %d\n", n);
else if (n % 5 == 4 || n % 5 == 0)
printf ("Drying in day %d\n", n);
}


## G - 最小的数

Description

Input

Output

AC代码：

#include<stdio.h>
int main()
{
int n, a, min = 10001;
scanf ("%d", &n);
for (int i = 0; i < n; i++)
{
scanf ("%d", &a);
if (a < min)
min = a;
}
printf ("%d\n", min);
}


## J - Found

Description

Input

Output

Sample Input
5 7
3 5 7 1 9

Sample Output
2

Sample Input 2
5 7
3 5 8 1 9

Sample Output 2

AC代码：

#include<stdio.h>
int main()
{
int n, x, a[21], flag = 0;
scanf ("%d%d", &n, &x);
for (int i = 0; i < n; i++)
scanf ("%d", &a[i]);
for (int i = 0; i < n; i++)
{
if (a[i] == x)
{
printf ("%d\n", i);
flag = 1;
break;
}
}
if (flag == 0)
}


## A - 相交？相离？相切

Description

Input

Output

Sample Input
1 1 2 2
1 1

Sample Output
intersect

Sample Input 2
1 1 1 1
1 1

Sample Output 2
Sample circle

Sample Input 3
1 1 3 1
1 1

Sample Output 3
tangent

AC代码：

#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
int x1, x2, y1, y2, r1, r2;
scanf ("%d%d%d%d%d%d", &x1, &y1, &x2, &y2, &r1, &r2);
if (x1 == x2 && y1 == y2 && r1 == r2)
printf ("Sample circle\n");
else
{
double s2 = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
double s1 = r1 + r2;
if (s2 == s1 || s2 == abs(r1 - r2)) printf ("tangent\n");
else if (s1 > s2 && s2 > abs(r1 - r2)) printf ("intersect\n");
else printf ("separation\n");
}
}


## E - 后缀名

Description

（规则如下：.java是java写的，.cpp是c++写的，*.c是c写的，如果不是这三种语言则输出none）。

Input

Output

Sample Input
a.cpp

Sample Output
c++

AC代码：

#include <iostream>
#include <string>
using namespace std;
int main()
{
int flag = 1;
string a;
while(cin >> a)
{
for (int i = 0; i < a.length(); i++)
{
if (a[i] == '.')
{
if (a[a.length() - 1] == 'c') cout << "c" << endl;
else if(a[a.length() - 1] == 'p' && a[a.length() - 2] == 'p' && a[a.length() - 3] == 'c') cout << "c++" << endl;
else if(a[a.length() - 1] == 'a' && a[a.length() - 2] == 'v' && a[a.length() - 3] == 'a' && a[a.length() - 4] == 'j') cout << "java" << endl;
else cout << "none" << endl;
flag = 1;
break;
}
else flag = 0;
}
if (flag == 0) cout << "none" << endl;
}
}


## H - BCD数

Description
BCD数是用一个字节来表达两位十进制的数，每四个比特表示一位。所以如果一个BCD数的十六进制是0x12，它表达的就是十进制的12。但是小明没学过BCD，把所有的BCD数都当作二进制数转换成十进制输出了。于是BCD的0x12被输出成了十进制的18了！

Input

Output

Sample Input
18

Sample Output
12

AC代码：

#include<stdio.h>
int main()
{
int n;
scanf ("%d", &n);
printf ("%d\n", n % 16 + n / 16 * 10);
}


## I - 猜数字

Description

Input

Output

Sample Input
58 4
70
50
56
58
60
-2

Sample Output
Too big
Too small
Too small
Good Guess!

AC代码：

#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
int a, n, x, flag = 0;
scanf ("%d%d", &a, &n);
for (int t = 1; t < 100; t++) {
scanf ("%d", &x);
if(x < 0 && t <= n) {
printf ("Game Over\n");
break;
}
else if (x >= 0) {
if (x > a && t <= n) printf ("Too big\n");
else if (x < a && t <= n) printf ("Too small\n");
else if (x == a && t <= n) {
flag = 1;
if (t == 1) {
printf ("Bingo!\n");
break;
}
else if (t == 2) {
printf ("Lucky You!\n");
break;
}
else if (t >= 3) {
printf ("Good Guess!\n");
break;
}
}
else if (flag == 0 && t > n) {
printf("Game Over\n");
break;
}
}
else if (t > n) {
if (flag == 0) {
printf ("Game Over\n");
break;
}
else break;
}
}
return 0;
}