View Code of Problem 446

#include <iostream>
#include <string>
#include <math.h>
using namespace std;

int main()
{
	int t;
	while (cin >> t) {
		int p, pa, pb;
		for (int i = 0; i < t; ++i) {
			cin >> p >> pa >> pb;
			if (abs(p - pa) < abs(p - pb)) cout << "A" << endl;
			else cout << "B" << endl;
					
		}
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 446