⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 2206.cpp

📁 这是哈尔滨工业大学acmOJ的源代码
💻 CPP
字号:
/*  This Code is Submitted by wywcgs for Problem 2206 on 2006-04-18 at 12:01:21 */ 
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

const int L = 128;

void expand(char*);
void suffixe(char*);

int main()
{
	char word[L];
	int t, T;
	
	scanf("%d\n", &T);
	for(t = 0; t < T; t++) { expand(gets(word)); putchar('\n'); }
	
	return 0;
}

void expand(char* str)
{
	if(!strncmp(str, "anti", 4)) { printf("against "); suffixe(str+4); }
	else if(!strncmp(str, "post", 4)) { printf("after "); suffixe(str+4); }
	else if(!strncmp(str, "pre", 3)) { printf("before "); suffixe(str+3); }
	else if(!strncmp(str, "re", 2)) { suffixe(str+2); printf(" again"); }
	else if(!strncmp(str, "un", 2)) { printf("not "); suffixe(str+2); }
	else suffixe(str);
}
void suffixe(char* str)
{
	int l = strlen(str);
	char last[5] = { str[l-1], str[l-2], str[l-3], str[l-4], 0 };
	if(!strncmp(last, "re", 2)) { str[l-2] = 0; printf("one who %ss", str); }
	else if(!strncmp(last, "gni", 3)) { str[l-3] = 0; printf("to actively %s", str); }
	else if(!strncmp(last, "ezi", 3)) { str[l-3] = 0; printf("change into %s", str); }
	else if(!strncmp(last, "s", 1)) { str[l-1] = 0; printf("multiple instances of %s", str); }
	else if(!strncmp(last, "noit", 4)) { str[l-4] = 0; printf("the process of %sing", str); }
	else printf("%s", str);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -