/in/foo.cc: In function 'int digit(int, int)':
/in/foo.cc:7:23: error: 'to_string' was not declared in this scope
int len=to_string(num).length();//取数值位数
^
/in/foo.cc:7:23: note: suggested alternatives:
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 /in/foo.cc:1:
/usr/include/c++/6/bits/basic_string.h:5522:3: note: 'std::__cxx11::to_string'
to_string(long double __val)
^~~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5522:3: note: 'std::__cxx11::to_string'
/in/foo.cc: In function 'int main()':
/in/foo.cc:27:2: error: 'cin' was not declared in this scope
cin>>num;
^~~
/in/foo.cc:27:2: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:60:18: note: 'std::cin'
extern istream cin; /// Linked to standard input
^~~
/in/foo.cc:28:23: error: 'to_string' was not declared in this scope
int len=to_string(num).size();
^
/in/foo.cc:28:23: note: suggested alternatives:
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 /in/foo.cc:1:
/usr/include/c++/6/bits/basic_string.h:5522:3: note: 'std::__cxx11::to_string'
to_string(long double __val)
^~~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5522:3: note: 'std::__cxx11::to_string'
/in/foo.cc:36:2: error: 'cout' was not declared in this scope
cout<<S<<endl;
^~~~
/in/foo.cc:36:2: note: suggested alternative:
In file included from /in/foo.cc:1:0:
/usr/include/c++/6/iostream:61:18: note: 'std::cout'
extern ostream cout; /// Linked to standard output
^~~~
/in/foo.cc:36:11: error: 'endl' was not declared in this scope
cout<<S<<endl;
^~~~
/in/foo.cc:36:11: note: suggested alternative:
In file included from /usr/include/c++/6/iostream:39:0,
from /in/foo.cc:1:
/usr/include/c++/6/ostream:590:5: note: 'std::endl'
endl(basic_ostream<_CharT, _Traits>& __os)
^~~~