1077. Kuchiguse (20)解题报告
来源:互联网 发布:皇室战争恶搞卡牌软件 编辑:程序博客网 时间:2024/06/07 12:24
#define _CRT_SECURE_NO_WARNINGS#include <cstdio>#include <cstdlib>#include <cstring>#include <string>const int N = 110;const int M = 300;inline void swap(char &c1, char &c2) { char c3 = c1; c1 = c2; c2 = c3; return;}int main(void) { int n, i, j, k, len; char str1[M], str2[M]; scanf("%d", &n); getchar(); fgets(str1, M, stdin); str1[strlen(str1) - 1] = '\0'; for (i = 0, j = strlen(str1) - 1; i < j; i++, j--) { swap(str1[i], str1[j]); } len = M; for (i = 1; i < n; i++) { fgets(str2, M, stdin); str2[strlen(str2) - 1] = '\0'; for (j = 0, k = strlen(str2) - 1; j < strlen(str1) && k >= 0 && str1[j] == str2[k]; j++, k--); if (len > j) { len = j; str1[j] = '\0'; } } for (i = 0, j = strlen(str1) - 1; i < j; i++, j--) { swap(str1[i], str1[j]); } if (strlen(str1)) { puts(str1); } else { puts("nai"); } return 0;}
0 0
- 1077. Kuchiguse (20)解题报告
- 1077. Kuchiguse (20)
- PAT 1077. Kuchiguse (20)
- PAT 1077. Kuchiguse (20)
- PAT 1077. Kuchiguse (20)
- PAT 1077. Kuchiguse (20)
- 1077. Kuchiguse (20)
- 1077. Kuchiguse (20)
- 1077. Kuchiguse (20)
- 1077. Kuchiguse (20)
- 1077. Kuchiguse (20)
- PAT 1077. Kuchiguse (20)
- PAT 1077. Kuchiguse (20)
- pat 1077. Kuchiguse (20)
- 1077. Kuchiguse (20)
- 1077. Kuchiguse (20)
- 1077. Kuchiguse (20)
- PAT 1077. Kuchiguse (20)
- Android系列之UI组件----Menu菜单
- Java并发---- Executor并发框架--线程池,ThreadToolExecutor初步理解
- it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping>
- 神经网络使用情景
- String.CopyTo
- 1077. Kuchiguse (20)解题报告
- Android关于Theme.AppCompat相关问题的深入分析
- 139. Word Break
- HttpURLConnection实现多线程下载
- int转 string
- 数据库学习笔记和小练习(6)sql查询和更新练习
- 面试专栏:算法与数据结构,虚拟机,Java基础,JavaWeb
- Swift 3.0 API设计准则
- EventBus 解析