Language: C++

#include <iostream>
using namespace std

float a;
float min = 1000000;
float max = 0;

int main(){
    while(cin >> a){
        if(a < min) min = a;  
        if(a > max) max = a; 
        count++;     
    }
    cout << max - min << endl; 
}


Compiler output:
a.cc:2:20: error: expected ';' before 'float'
    2 | using namespace std
      |                    ^
      |                    ;
    3 | 
    4 | float a;
      | ~~~~~               
a.cc: In function 'int main()':
a.cc:10:16: error: reference to 'min' is ambiguous
   10 |         if(a < min) min = a;
      |                ^~~
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:7: note:                 'float min'
    5 | float min = 1000000;
      |       ^~~
a.cc:10:21: error: reference to 'min' is ambiguous
   10 |         if(a < min) min = a;
      |                     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:7: note:                 'float min'
    5 | float min = 1000000;
      |       ^~~
a.cc:11:16: error: reference to 'max' is ambiguous
   11 |         if(a > max) max = a;
      |                ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:6:7: note:                 'float max'
    6 | float max = 0;
      |       ^~~
a.cc:11:21: error: reference to 'max' is ambiguous
   11 |         if(a > max) max = a;
      |                     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:6:7: note:                 'float max'
    6 | float max = 0;
      |       ^~~
a.cc:12:9: error: 'count' was not declared in this scope
   12 |         count++;
      |         ^~~~~
a.cc:14:13: error: reference to 'max' is ambiguous
   14 |     cout << max - min << endl;
      |             ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:                 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:6:7: note:                 'float max'
    6 | float max = 0;
      |       ^~~
a.cc:14:19: error: reference to 'min' is ambiguous
   14 |     cout << max - min << endl;
      |                   ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidates are: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:                 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
a.cc:5:7: note:                 'float min'
    5 | float min = 1000000;
      |       ^~~