Start: Jan, 04, 2017 19:40:00
2016年秋季学期程序设计基础期末考试
End: Jan, 04, 2017 21:40:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 1ms
Memory: 1096kB
Author: 2016210402088
In contest: 1084

#include <stdio.h>
#include <string.h>
int main ()
{
	int a, c, d;
	char b[200];
	scanf ("%d", &a);
	getchar();
	while (a--)
	{
		gets (b);
		for (c = 0; c < strlen(b); c++)
		{
			if ((b[c] == 's' || b[c] == 'S') && (b[c + 1] == 's'|| b[c + 1] == 'S') && (b[c + 2] == 'r'|| b[c + 2] == 'R' ))
			{
				printf ("***");
				c += 2;
			}
			else if ((b[c] == 'a' || b[c] == 'A') && (b[c + 1] == 'f'|| b[c + 1] == 'F') && (b[c + 2] == 'r'|| b[c + 2] == 'R' ) && (b[c + 3] == 'i' || b[c + 3] == 'I') && (b[c + 4] == 'c'|| b[c + 4] == 'C') && (b[c + 5] == 'a'|| b[c + 5] == 'A' ))
			{
				printf ("AFRICA");
				c += 5;
			}
			else 
				printf ("%c", b[c]);
		}
		printf ("\n");
	}
	return 0;
}