U E D R , A S I H C RSS

데블스캠프2006/월요일/연습문제/switch/정승희

~cpp
#include <iostream>
using namespace std;

int main()
{
	int n[10]={0,},p[5]={0,};
	for(int i=0;i<10;i++)
	{	cin >> n[i];
	switch(n[i]/10){
	case 6:
		p[0]++;
		break;
	case 7:
		p[1]++;
		break;
	case 8:
		p[2]++;
		break;
	case 9:
		p[3]++;
		break;
	case 10:
		p[3]++;
		break;
	default:
		p[4]++;
		break;
	}
	
	}
	cout << "A:"<<p[3]<<"B:"<<p[2]<<"C:"<<p[1]<<"D:"<<p[0]<<"F:"<<p[4];
	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:04
Processing time 0.0100 sec