U E D R , A S I H C RSS

데블스캠프2006/월요일/연습문제/switch/주소영

No older revisions available

No older revisions available



==주소영==
~cpp
#include <iostream>
using namespace std;

int main()
{
	int score[10]={0,},i,n,a,b,c,d,f;
	a=0;
	b=0;
	c=0;
	d=0;
	f=0;

	cout <<"최대 10명의 성적을 입력 하세요\n";

	while (n != 999){
		cout << "학생의 성적을 입력 하세요\n";
		cin >> n;

		cout <<"입력 종료하려면 999";
	
		switch(n/10)
		{
		case 9:
			a++;
			break;
		case 8:
			b++;
			break;
		case 7:
			c++;
			break;
		case 6:
			d++;
			break;
		default:
			f++;
			break;
		}
	}

	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.0132 sec