U E D R , A S I H C RSS

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

== 성우용 ==

~cpp
#include <iostream>
using namespace std;

int main()
{
	int i=0;
	int n;
	int A=0,B=0,C=0,D=0,F=0;
	if(i<10)
	{
		do
		{
			cout << "숫자를 입력하세요";
			cin >> n;
			i++;			
			switch(n / 10 )
			{
			case 10:
			case 9:
				A++;
				break;
			case 8:
				B++;
				break;
			case 7:
				C++;
				break;
			case 6:
				D++;
				break;
			case 5:
			case 4:
			case 3:
			case 2:
			case 1:
			case 0:
				F++;
				break;
			}
		}while( n!= 999 );
	}
	cout << A <<"\n";
	cout << B <<"\n";
	cout << C <<"\n";
	cout << D <<"\n";
	cout << F <<"\n";
	return 0;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:04
Processing time 0.0092 sec