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: 2016210402074
In contest: 1084

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