Language: C++

Last login: Tue Sep 11 13:04:54 on ttys000
Kosuke-no-MacBook-Pro:~ Kosuke$ cd Atcorder
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ emacs
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ g++ -o a abc079c.cpp
abc079c.cpp:11:29: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                            ^
                            ;
abc079c.cpp:11:33: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                ^
                                ;
abc079c.cpp:11:35: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                  ^
                                  ;
abc079c.cpp:11:39: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                      ^
                                      ;
abc079c.cpp:11:41: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                        ^
                                        ;
abc079c.cpp:11:45: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                            ^
                                            ;
abc079c.cpp:11:51: error: reference to overloaded function could not be
      resolved; did you mean to call it?
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                                  ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:1032:1: note: 
      possible target for call
endl(basic_ostream<_CharT, _Traits>& __os)
^
abc079c.cpp:11:30: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                             ^~~
abc079c.cpp:11:34: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                 ^
abc079c.cpp:11:36: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                   ^~~
abc079c.cpp:11:40: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                       ^
abc079c.cpp:11:42: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a "+" b "+" c "+" d << endl;
                                         ^~~
5 warnings and 7 errors generated.
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ g++ -o a abc079c.cpp
abc079c.cpp:11:29: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                            ^
                            ;
abc079c.cpp:11:33: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                ^
                                ;
abc079c.cpp:11:35: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                  ^
                                  ;
abc079c.cpp:11:39: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                      ^
                                      ;
abc079c.cpp:11:41: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                        ^
                                        ;
abc079c.cpp:11:45: error: expected ';' after expression
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                            ^
                                            ;
abc079c.cpp:11:51: error: reference to overloaded function could not be
      resolved; did you mean to call it?
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                                  ^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream:1032:1: note: 
      possible target for call
endl(basic_ostream<_CharT, _Traits>& __os)
^
abc079c.cpp:11:30: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                             ^~~
abc079c.cpp:11:34: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                 ^
abc079c.cpp:11:36: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                   ^~~
abc079c.cpp:11:40: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                       ^
abc079c.cpp:11:42: warning: expression result unused [-Wunused-value]
  if(a+b+c+d == 7) cout << a '+' b '+' c '+' d << endl;
                                         ^~~
5 warnings and 7 errors generated.
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ ./a
1222

q
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ 
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ g++ -o a abc079c.cpp
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ ./a
1222
a+b+c+d=7
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ ./a
2222
Kosuke-no-MacBook-Pro:Atcorder Kosuke$ emacs

#include<iostream>
using namespace std;
typedef long long ll;

int main(){
  string s;
  cin >>s;
  int N=s.size();
  ll ans=0;
  for(int i=0;i<N;i++){
    ll num=s[0] - '0';
    for(int j=0;j<n-1;j++){
      if(i&(1<<j)){
	ans += num;
	num=0;
      }
      num = num * 10 +s[j+1] - '0';
    }
    ans += num;
  }
  cout << ans << ensdl;
}


Compiler output:
a.cc:1:1: error: 'Last' does not name a type
    1 | Last login: Tue Sep 11 13:04:54 on ttys000
      | ^~~~
a.cc:7:29: error: expected unqualified-id before '^' token
    7 |                             ^
      |                             ^
a.cc:9:1: error: 'abc079c' does not name a type
    9 | abc079c.cpp:11:33: error: expected ';' after expression
      | ^~~~~~~
a.cc:11:33: error: expected unqualified-id before '^' token
   11 |                                 ^
      |                                 ^
a.cc:13:1: error: 'abc079c' does not name a type
   13 | abc079c.cpp:11:35: error: expected ';' after expression
      | ^~~~~~~
a.cc:15:35: error: expected unqualified-id before '^' token
   15 |                                   ^
      |                                   ^
a.cc:17:1: error: 'abc079c' does not name a type
   17 | abc079c.cpp:11:39: error: expected ';' after expression
      | ^~~~~~~
a.cc:19:39: error: expected unqualified-id before '^' token
   19 |                                       ^
      |                                       ^
a.cc:21:1: error: 'abc079c' does not name a type
   21 | abc079c.cpp:11:41: error: expected ';' after expression
      | ^~~~~~~
a.cc:23:41: error: expected unqualified-id before '^' token
   23 |                                         ^
      |                                         ^
a.cc:25:1: error: 'abc079c' does not name a type
   25 | abc079c.cpp:11:45: error: expected ';' after expression
      | ^~~~~~~
a.cc:27:45: error: expected unqualified-id before '^' token
   27 |                                             ^
      |                                             ^
a.cc:29:1: error: 'abc079c' does not name a type
   29 | abc079c.cpp:11:51: error: reference to overloaded function could not be
      | ^~~~~~~
a.cc:30:17: error: 'did' does not name a type
   30 |       resolved; did you mean to call it?
      |                 ^~~
a.cc:32:51: error: expected unqualified-id before '^' token
   32 |                                                   ^~~~
      |                                                   ^
a.cc:39:30: error: expected unqualified-id before '^' token
   39 |                              ^~~
      |                              ^
a.cc:42:34: error: expected unqualified-id before '^' token
   42 |                                  ^
      |                                  ^
a.cc:45:36: error: expected unqualified-id before '^' token
   45 |                                    ^~~
      |                                    ^
a.cc:48:40: error: expected unqualified-id before '^' token
   48 |                                        ^
      |                                        ^
a.cc:51:42: error: expected unqualified-id before '^' token
   51 |                                          ^~~
      |                                          ^
a.cc:56:29: error: expected unqualified-id before '^' token
   56 |                             ^
      |                             ^
a.cc:58:1: error: 'abc079c' does not name a type
   58 | abc079c.cpp:11:33: error: expected ';' after expression
      | ^~~~~~~
a.cc:60:33: error: expected unqualified-id before '^' token
   60 |                                 ^
      |                                 ^
a.cc:62:1: error: 'abc079c' does not name a type
   62 | abc079c.cpp:11:35: error: expected ';' after expression
      | ^~~~~~~
a.cc:64:35: error: expected unqualified-id before '^' token
   64 |                                   ^
      |                                   ^
a.cc:66:1: error: 'abc079c' does not name a type
   66 | abc079c.cpp:11:39: error: expected ';' after expression
      | ^~~~~~~
a.cc:68:39: error: expected unqualified-id before '^' token
   68 |                                       ^
      |                                       ^
a.cc:70:1: error: 'abc079c' does not name a type
   70 | abc079c.cpp:11:41: error: expected ';' after expression
      | ^~~~~~~
a.cc:72:41: error: expected unqualified-id before '^' token
   72 |                                         ^
      |                                         ^
a.cc:74:1: error: 'abc079c' does not name a type
   74 | abc079c.cpp:11:45: error: expected ';' after expression
      | ^~~~~~~
a.cc:76:45: error: expected unqualified-id before '^' token
   76 |                                             ^
      |                                             ^
a.cc:78:1: error: 'abc079c' does not name a type
   78 | abc079c.cpp:11:51: error: reference to overloaded function could not be
      | ^~~~~~~
a.cc:79:17: error: 'did' does not name a type
   79 |       resolved; did you mean to call it?
      |                 ^~~
a.cc:81:51: error: expected unqualified-id before '^' token
   81 |                                                   ^~~~
      |                                                   ^
a.cc:88:30: error: expected unqualified-id before '^' token
   88 |                              ^~~
      |                              ^
a.cc:91:34: error: expected unqualified-id before '^' token
   91 |                                  ^
      |                                  ^
a.cc:94:36: error: expected unqualified-id before '^' token
   94 |                                    ^~~
      |                                    ^
a.cc:97:40: error: expected unqualified-id before '^' token
   97 |                                        ^
      |                                        ^
a.cc:100:42: error: expected unqualified-id before '^' token
  100 |                                          ^~~
      |                                          ^
In file included from /usr/include/c++/14/iosfwd:42,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:115:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
   68 |   typedef ptrdiff_t     streamsize; // Signed integral type
      |           ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
   40 | #include <cwchar> // For mbstate_t
  +++ |+#include <cstddef>
   41 | 
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
                 from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
  131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                            ^~~~~~
In file included from /usr/include/wchar.h:35,
                 from /usr/include/c++/14/cwchar:44,
                 from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  132 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
  133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                              ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  134 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
  140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
      |                             ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
  142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
      |                               ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                          ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                            ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
  145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                                    ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
  147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                          ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                              ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~