C++ Golf Puan Hesaplama (Cin.Clear) Hakkinda (1 İzleyici)

Nishimura

Üye
Katıldı
Mesajlar
29
Yaşadığın yer
Moskova
Kredi
0
Merhaba Arkadaslar.. Cin,clear hakkinda bir ornegimi paylasacagim GOLF puan hesaplama...(Dizi ile..)

Kod:
const int adet = 5;
	int golf[adet];
	cout << "Lutfen Golf Skor Giriniz.\n";
	cout << "Raound Adedimiz " << adet << ".\n";
	int i;

	for (i = 0; i < adet; i++)
	{
		cout << "Raound #" << i + 1 << ": ";
		while (!(cin >> golf[i])){
			cin.clear();

			while (cin.get() != '\n')
				continue;
			cout << "Lutfen Skorunuz Giriniz!!! :";
		}


	}

	double toplam = 0.0;
	for (i = 0; i < adet; i++)
		toplam = toplam + golf[i];
	cout << toplam / adet << "= Bolunmus skor " << adet << "raound\n\n";


"TARAFIMCA EKLENEN SCRIPTLER BANA AIT OLUP KOPYALANMASI ANINDA (ALINTI) IBARESI EKLENMESI RICA OLUNUR"
 

Bu konuyı kimler okuyor

Benzer konular

Top