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

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