hdoj 1048 the hardest problem ever (水题)

思路:翻译规则,照例输入

代码如下:

#include 
#include 
#include 
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
#define  p 3.1415927
char end[]="ENDOFINPUT";
char start[]="START";

int judge(char *a,char *b)
{
	int i;
	int len=strlen(a);
	for(i=0;i='F' && a[i]<='Z')
			a[i]=(char)((int)a[i]-5);
		else if (a[i]<'F'&&a[i]>='A')
			a[i]=(char)((int)a[i]+26-5);
			
			
	}
	
}

int main(int argc, char *argv[]) 
{
	char a[300];
	int i;
	int key=0;
	
	while(1)
	{
		
		if(scanf("%s",a))
		{
			if(judge(a,end)==0)
				break;
			if(judge(a,start)==0)
			{
				getchar();
				gets(a);
				fy(a);
				printf("%s\n",a);
			}
			
		}
		scanf("%s",a);
		
		
	} 
	
	return 0;
}


你可能感兴趣的:(模拟+water~~)