День добрый. Подскажите почему ругается компилятор на using std:: во всех строках ? Программа не компилируется ,почему?
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <iomanip>
using std::setprecision;
using std::setiosflags;
int main()
{
int total,
gradeCounter,
grade;
double average;
total = 0;
gradeCounter = 0;
cout << "Введите оцеку или -1 для завершения: ";
cin >> grade;
while (grade != -1){
total = total + grade;
gradeCounter = gradeCounter + 1;
cout << "Введите оцеку или -1 для завершения: ";
cin >> grade;
}
if (gradeCounter != 0){
average = static_cast< double >( total ) / gradeCounter;
cout << "Средняя оценка равна" << setprecision( 2 )
<< setiosflags( ios::fixed | ios::showpoint )
<< average << endl;
}
else
cout << "Нет введенных оценок" << endl;
return 0;
}
Вроде все верно ?