3
87.342 34.30 start 0 walk 10.0
2.6762 75.2811 start -45.0 walk 40 turn 40.0 walk 60
58.518 93.508 start 270 walk 50 turn 90 walk 40 turn 13 walk 5
2
30 40 start 90 walk 5
40 50 start 180 walk 10 turn 90 walk 5
0
prog.cpp: In function ‘float moy(float, int)’:
prog.cpp:16:5: error: ‘flaot’ was not declared in this scope
flaot m=0;
^~~~~
prog.cpp:17:19: error: ‘n’ was not declared in this scope
for(int i=0;i<n;i++)m+=f[i];
^
prog.cpp:17:31: error: invalid types ‘float[int]’ for array subscript
for(int i=0;i<n;i++)m+=f[i];
^
prog.cpp:18:14: error: ‘n’ was not declared in this scope
return m/n;
^
prog.cpp: In function ‘int main()’:
prog.cpp:33:9: error: ‘flaot’ was not declared in this scope
flaot dis[n];
^~~~~
prog.cpp:38:26: error: no matching function for call to ‘getline(std::__cxx11::string&, std::istream&)’
getline(s,cin);
^
In file included from /usr/include/stdio.h:935:0,
from /usr/include/c++/6/cstdio:42,
from /usr/include/c++/6/ext/string_conversions.h:43,
from /usr/include/c++/6/bits/basic_string.h:5417,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/x86_64-linux-gnu/bits/stdio.h:115:1: note: candidate: __ssize_t getline(char**, size_t*, FILE*)
getline (char **__lineptr, size_t *__n, FILE *__stream)
^~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdio.h:115:1: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5395:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
getline(basic_istream<_CharT, _Traits>&& __is,
^~~~~~~
/usr/include/c++/6/bits/basic_string.h:5395:5: note: template argument deduction/substitution failed:
prog.cpp:38:26: note: ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
getline(s,cin);
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5388:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
getline(basic_istream<_CharT, _Traits>&& __is,
^~~~~~~
/usr/include/c++/6/bits/basic_string.h:5388:5: note: template argument deduction/substitution failed:
prog.cpp:38:26: note: ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
getline(s,cin);
^
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5380:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
getline(basic_istream<_CharT, _Traits>& __is,
^~~~~~~
/usr/include/c++/6/bits/basic_string.h:5380:5: note: template argument deduction/substitution failed:
prog.cpp:38:26: note: ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
getline(s,cin);
^
In file included from /usr/include/c++/6/string:53:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.tcc:1509:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
getline(basic_istream<_CharT, _Traits>& __in,
^~~~~~~
/usr/include/c++/6/bits/basic_string.tcc:1509:5: note: template argument deduction/substitution failed:
prog.cpp:38:26: note: ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ is not derived from ‘std::basic_istream<_CharT, _Traits>’
getline(s,cin);
^
prog.cpp:50:27: error: invalid types ‘char[int]’ for array subscript
t[j][i]=s[i];
^
prog.cpp:57:26: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
case "start" :
^~~~~~~
prog.cpp:57:26: error: ‘(int)((const char*)"start")’ is not a constant expression
prog.cpp:59:42: error: request for member ‘c_str’ in ‘t[(i + 1)]’, which is of non-class type ‘char’
al= atof( t[i+1].c_str() );
^~~~~
prog.cpp:62:26: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
case "walk" :
^~~~~~
prog.cpp:62:26: error: ‘(int)((const char*)"walk")’ is not a constant expression
prog.cpp:64:28: error: invalid types ‘float[int]’ for array subscript
d[o]+=atof( t[i+1].c_str() );
^
prog.cpp:64:44: error: request for member ‘c_str’ in ‘t[(i + 1)]’, which is of non-class type ‘char’
d[o]+=atof( t[i+1].c_str() );
^~~~~
prog.cpp:65:44: error: request for member ‘c_str’ in ‘t[(i + 1)]’, which is of non-class type ‘char’
x[o]+=atof( t[i+1].c_str() )*cos(al);
^~~~~
prog.cpp:66:44: error: request for member ‘c_str’ in ‘t[(i + 1)]’, which is of non-class type ‘char’
y[o]+=atof( t[i+1].c_str() )*sin(al);
^~~~~
prog.cpp:69:26: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive]
case "turn" :
^~~~~~
prog.cpp:69:26: error: ‘(int)((const char*)"turn")’ is not a constant expression
prog.cpp:71:41: error: request for member ‘c_str’ in ‘t[(i + 1)]’, which is of non-class type ‘char’
al=atof( t[i+1].c_str() );
^~~~~
prog.cpp:77:46: error: cannot convert ‘float*’ to ‘float’ for argument ‘1’ to ‘float moy(float, int)’
printf("%.4f %.4f %.5f\n",moy(x,n),moy(x,n),max(d,n));
^
prog.cpp:77:55: error: cannot convert ‘float*’ to ‘float’ for argument ‘1’ to ‘float moy(float, int)’
printf("%.4f %.4f %.5f\n",moy(x,n),moy(x,n),max(d,n));
^
prog.cpp:77:64: error: no matching function for call to ‘max(float&, int&)’
printf("%.4f %.4f %.5f\n",moy(x,n),moy(x,n),max(d,n));
^
prog.cpp:5:7: note: candidate: float max(float*, int)
float max(float *f, int n)
^~~
prog.cpp:5:7: note: no known conversion for argument 1 from ‘float’ to ‘float*’
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
prog.cpp:77:64: note: deduced conflicting types for parameter ‘const _Tp’ (‘float’ and ‘int’)
printf("%.4f %.4f %.5f\n",moy(x,n),moy(x,n),max(d,n));
^
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: candidate: template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
prog.cpp:77:64: note: deduced conflicting types for parameter ‘const _Tp’ (‘float’ and ‘int’)
printf("%.4f %.4f %.5f\n",moy(x,n),moy(x,n),max(d,n));
^