-
Notifications
You must be signed in to change notification settings - Fork 0
/
03.c
58 lines (58 loc) · 1.16 KB
/
03.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// -*- coding:gb2312 -*-
/* -----
* File: d:\0-Document\Code\ncre-col2-c\03.c
* Project: d:\0-document\code\ncre-col2-c
* Created Date: 2023-05-18 12:30:54
* Last Modified: 2023-05-19 12:38:39
* -----
* Author: ZhaoWentao
* AutherEmail: linyushu0513@qq.com
* -----
* Keep learning Keep thinking Keep searching
* -----
* DESCRIPTION:
*
* -----
* HISTORY:
* Date By Comments
* ---------------- --- ----------------
*/
#include <stdio.h>
#include <string.h>
void fun(char s[]);
int main()
{
char s[80];
int i;
int move = 3;
printf("Please input the code:\n");
gets(s);
for (i = 0; i < strlen(s); i++)
{
s[i] = ((s[i] - 'A') + move) % 26 + 'A';
}
printf("After jiemi\n");
puts(s);
printf("\n");
fun(s);
return 0;
}
void fun(char s[])
{
int i = 0, flag = 1;
for (i = 0; i < strlen(s); i++)
{
if (s[i] != 'L')
continue;
else if (s[i + 1] == 'O' && s[i + 2] == 'V' && s[i + 3] == 'E')
{
printf("Yes\n");
flag = 0;
break;
}
else
continue;
}
if (flag)
printf("No\n");
}