U E D R , A S I H C RSS

ACM_ICPC/Problems/6542


솔직히 이 문제 너무 쉬웠다고밖에는.......

황현

#include <stdio.h>
#include <math.h>


int main() {
	int T, c, x, y, i;
	double p;

	scanf("%d", &T);
	for (i = 0; i < T; ++i) {
		x = y = 0;
		p = .0;
		scanf("%d", &c);
		getc(stdin);
		switch (getc(stdin)) {
		case 'Y':
			x += 3;
			y += 10;
		case 'Z':
			x += 3;
			y += 10;
		case 'E':
			x += 3;
			y += 10;
		case 'P':
			x += 3;
			y += 10;
		case 'T':
			x += 3;
			y += 10;
		case 'G':
			x += 3;
			y += 10;
		case 'M':
			x += 3;
			y += 10;
		case 'K':
			x += 3;
			y += 10;
			getc(stdin);
		case 'B':
			break;
		}
		getc(stdin);
		y -= x;
		printf("Case #%d: %.2lf%%\n", i + 1, round((1.0 - (pow(5, x) / pow(2, y))) * 10000.0) / 100.0);
	}

	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:22:21
Processing time 0.0144 sec