fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a = 10;
  6. int b = 2;
  7. int c = 4;
  8.  
  9. if (a + b c) {
  10. cout >> "T"; }
  11. elif ( a + c > b) {
  12. cout >> "A"; }
  13. elif ( b + c > a) {
  14. cout << 'K" ' }
  15.  
  16.  
  17.  
  18.  
  19.  
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:9:12: error: expected ')'
if (a + b  c) {
           ^
prog.cpp:9:4: note: to match this '('
if (a + b  c) {
   ^
prog.cpp:10:6: error: invalid operands to binary expression ('ostream' (aka 'basic_ostream<char>') and 'const char *')
cout >> "T"; }
~~~~ ^  ~~~
/usr/bin/../lib/gcc/i586-linux-gnu/4.9/../../../../include/c++/4.9/streambuf:168:9: note: candidate template ignored: could not match 'basic_istream' against 'basic_ostream'
        operator>>(basic_istream<_CharT2, _Traits2>&,
        ^
/usr/bin/../lib/gcc/i586-linux-gnu/4.9/../../../../include/c++/4.9/istream:727:5: note: candidate template ignored: could not match 'basic_istream' against 'basic_ostream'
    operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
    ^
/usr/bin/../lib/gcc/i586-linux-gnu/4.9/../../../../include/c++/4.9/istream:732:5: note: candidate template ignored: could not match 'basic_istream' against 'basic_ostream'
    operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
    ^
/usr/bin/../lib/gcc/i586-linux-gnu/4.9/../../../../include/c++/4.9/istream:774:5: note: candidate template ignored: could not match 'basic_istream' against 'basic_ostream'
    operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
    ^
/usr/bin/../lib/gcc/i586-linux-gnu/4.9/../../../../include/c++/4.9/istream:779:5: note: candidate template ignored: could not match 'basic_istream' against 'basic_ostream'
    operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
    ^
/usr/bin/../lib/gcc/i586-linux-gnu/4.9/../../../../include/c++/4.9/bits/istream.tcc:923:5: note: candidate template ignored: could not match 'basic_istream' against 'basic_ostream'
    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
    ^
/usr/bin/../lib/gcc/i586-linux-gnu/4.9/../../../../include/c++/4.9/bits/istream.tcc:955:5: note: candidate template ignored: could not match 'basic_istream' against 'basic_ostream'
    operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
    ^
prog.cpp:11:1: error: use of undeclared identifier 'elif'
elif ( a + c > b) {
^
3 errors generated.
stdout
Standard output is empty