重做 USACO 1.1 你的飞碟在这儿

  不解释了..
/*
LANG: C
ID: zqynux11
PROG: ride
*/
#include <stdio.h>
#define loop(i, j)\
p = i;\
while(*p != '\0'){\
	j *= *p - 'A' + 1;\
	p++;\
}/* 之前将p++掉了.. */


int main(void)
{
	char ufo[7], name[7];
	char *p;
	int a = 1, b = 1;
	freopen("ride.in", "r", stdin);
	freopen("ride.out", "w", stdout);

	gets(ufo);
	gets(name);

	loop(ufo, a);
	loop(name, b);
	if(a % 47 == b % 47){
		puts("GO");
	}else{
		puts("STAY");
	}
	return 0;
}

你可能感兴趣的:(C++,c,C#,J#,Go)