Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

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

From ZeroWiki
Revision as of 08:22, 13 January 2014 by imported>qa22ahj
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

윤성준

#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;
}