fork download
  1. #include<cstdio>
  2. #include<sstream>
  3. #include<cstdlib>
  4. #include<cctype>
  5. #include<cmath>
  6. #include<algorithm>
  7. #include<set>
  8. #include<queue>
  9. #include<stack>
  10. #include<list>
  11. #include<iostream>
  12. #include<fstream>
  13. #include<numeric>
  14. #include<string>
  15. #include<vector>
  16. #include<cstring>
  17. #include<map>
  18. #include<iterator>
  19. using namespace std;
  20. #define ll long long int
  21. #define mx 10000005
  22. #define mod 100000007
  23. #define inf 0x3f3f3f3f
  24.  
  25. int main()
  26. {
  27. char s[100005];
  28. int i,l;
  29. for(i=0;i<10000007;i++){
  30. getline(cin,s);
  31. vector<char>a;
  32. vector<char>b;
  33. if(strcmp(s,"DONE")==0)return 0;
  34. l=strlen(s);
  35. for(i=0;i<l;i++){
  36. if(s[i]>='A' && s[i]<='Z') s[i]+=32;
  37. if(s[i]>='a' && s[i]<='z') a.push_back(s[i]);
  38. }
  39. b=a;
  40. reverse(b.begin(),b.end());
  41. if(a==b)cout<<"You won't be eaten!"<<endl;
  42. else cout<<"Uh oh.."<<endl;
  43. }
  44. }
  45.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:30:30: error: no matching function for call to ‘getline(std::istream&, char [100005])’
                 getline(cin,s);
                              ^
In file included from /usr/include/stdio.h:935:0,
                 from /usr/include/c++/6/cstdio:42,
                 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/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from prog.cpp:2:
/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:30:30: note:   mismatched types ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘char [100005]’
                 getline(cin,s);
                              ^
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/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from prog.cpp:2:
/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:30:30: note:   mismatched types ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘char [100005]’
                 getline(cin,s);
                              ^
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/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from prog.cpp:2:
/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:30:30: note:   mismatched types ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘char [100005]’
                 getline(cin,s);
                              ^
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/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from prog.cpp:2:
/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:30:30: note:   mismatched types ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’ and ‘char [100005]’
                 getline(cin,s);
                              ^
stdout

Standard output is empty