U E D R , A S I H C RSS

데블스캠프2006/월요일/연습문제/switch/윤성준

윤성준


#include <iostream>

using namespace std;

int main(void)
{
	int a = 0, b = 0, c = 0, d = 0, f = 0, res, n = 0;
	do {		
		n++;			
		cin >> res;
		switch (res/10) {
			case 10:
				a++;
				break;
			case 9:
				a++;
				break;
			case 8:
				b++;
				break;
			case 7:
				c++;
				break;
			case 6:
				d++;
				break;
			default:
				f++;
				break;
		}
	} while (n <= 10 && res != 999);

	cout << "A: " << a << "명" << endl;
	cout << "B: " << b << "명" << endl;
	cout << "C: " << c << "명" << endl;
	cout << "D: " << d << "명" << endl;
	cout << "F: " << f << "명" << endl;
	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:04
Processing time 0.0115 sec