Language: C++

#include <iostream>
#include <cstdio>
#include <string>

int main() {
  int n;

  while(std::getline(std::cin, n)) {
    if(n == 0) break;
    int *score = new int[n];
    int sum = 0;
    for(int i = 0; i < n; ++i) {
      std::cin >> score[i];
      sum += score[i];
    }
    double average = sum / n;
    double alpha = 0;
    for(int i = 0; i < n; ++i) {
      alpha += (score[i] - average) +(score[i] - average);
    }
    alpha /= n;
    printf("%.4f\n", alpha);
    delete[] score;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:21: error: no matching function for call to 'getline(std::istream&, int&)'
    8 |   while(std::getline(std::cin, n)) {
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:55,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.tcc:907:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
  907 |     getline(basic_istream<_CharT, _Traits>& __in,
      |     ^~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:907:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/string:54:
/usr/include/c++/14/bits/basic_string.h:4117:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 4117 |     getline(basic_istream<_CharT, _Traits>& __is,
      |     ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:4117:5: note:   template argument deduction/substitution failed:
a.cc:8:21: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
    8 |   while(std::getline(std::cin, n)) {
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4125:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)'
 4125 |     getline(basic_istream<_CharT, _Traits>&& __is,
      |     ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:4125:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:4132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(basic_istream<_CharT, _Traits>&&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 4132 |     getline(basic_istream<_CharT, _Traits>&& __is,
      |     ^~~~~~~
/usr/include/c++/14/bits/basic_string.h:4132:5: note:   template argument deduction/substitution failed:
a.cc:8:21: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
    8 |   while(std::getline(std::cin, n)) {
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~