Language: C++

Last login: Wed Apr 27 15:37:25 on console
pc111089m:~ 0019055847$ ls
Desktop		Library		Pictures	a.cpp
Documents	Movies		Public		a.out
Downloads	Music		a		myfolder
pc111089m:~ 0019055847$ cd Documents
pc111089m:Documents 0019055847$ ls
c		include.txt	program
pc111089m:Documents 0019055847$ cd c
pc111089m:c 0019055847$ ls
pc111089m:c 0019055847$ vim as.cpp
pc111089m:c 0019055847$ g++ as.cpp
as.cpp:31:3: error: use of undeclared identifier 'cin'; did you mean 'sin'?
                cin>>n;
                ^~~
                sin
/usr/include/math.h:343:15: note: 'sin' declared here
extern double sin(double);
              ^
as.cpp:31:8: error: use of undeclared identifier 'n'
                cin>>n;
                     ^
as.cpp:32:6: error: use of undeclared identifier 'n'
                if(n==0)break;
                   ^
as.cpp:33:3: error: use of undeclared identifier 'cout'; did you mean
      'std::cout'?
                cout<<a[n]<<endl;
                ^~~~
                std::cout
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:50:33: note: 
      'std::cout' declared here
extern _LIBCPP_FUNC_VIS ostream cout;
                                ^
as.cpp:33:11: error: use of undeclared identifier 'n'
                cout<<a[n]<<endl;
                        ^
as.cpp:33:15: error: use of undeclared identifier 'endl'
                cout<<a[n]<<endl;
                            ^
6 errors generated.
pc111089m:c 0019055847$ 
pc111089m:c 0019055847$ vim as.cpp
pc111089m:c 0019055847$ g++ as.cpp
as.cpp:32:8: error: use of undeclared identifier 'n'
                cin>>n;
                     ^
as.cpp:33:6: error: use of undeclared identifier 'n'
                if(n==0)break;
                   ^
as.cpp:34:11: error: use of undeclared identifier 'n'
                cout<<a[n]<<endl;
                        ^
3 errors generated.
pc111089m:c 0019055847$ vim as.cpp
pc111089m:c 0019055847$ g++ as.cpp
pc111089m:c 0019055847$ ls
a.out	as.cpp
pc111089m:c 0019055847$ ./a.out
1
1
25
3
2003
48
211
7
20007
738
0
pc111089m:c 0019055847$ vim as.cpp

#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<algorithm>
#include<cstdlib>
using namespace std;
#define rep2(x,from,to) for(int x=(from);(x)<(to);(x)++)
#define rep(x,to) rep2(x,0,to)
int a[32769];
int n;
int main()
{
        rep(i,182)
        {
                rep2(j,i,182)
                {
                        if(i*i+j*j>=32769)break;
                        rep2(k,j,182)
                        {
                                if(i*i+j*j+k*k>=32769)break;
                                rep2(l,k,182)
                                {
                                        if(i*i+j*j+k*k+l*l>=32769)break;
                                        a[i*i+j*j+k*k+l*l]++;

                                }
                        }
                }
        }
        while(1)
        {
                cin>>n;
                if(n==0)break;
                cout<<a[n]<<endl;
        }
        return 0;
}

Compiler output:
a.cc:2:13: error: invalid digit "9" in octal constant
    2 | pc111089m:~ 0019055847$ ls
      |             ^~~~~~~~~~~
a.cc:6:13: error: invalid digit "9" in octal constant
    6 | pc111089m:~ 0019055847$ cd Documents
      |             ^~~~~~~~~~~
a.cc:7:21: error: invalid digit "9" in octal constant
    7 | pc111089m:Documents 0019055847$ ls
      |                     ^~~~~~~~~~~
a.cc:9:21: error: invalid digit "9" in octal constant
    9 | pc111089m:Documents 0019055847$ cd c
      |                     ^~~~~~~~~~~
a.cc:10:13: error: invalid digit "9" in octal constant
   10 | pc111089m:c 0019055847$ ls
      |             ^~~~~~~~~~~
a.cc:11:13: error: invalid digit "9" in octal constant
   11 | pc111089m:c 0019055847$ vim as.cpp
      |             ^~~~~~~~~~~
a.cc:12:13: error: invalid digit "9" in octal constant
   12 | pc111089m:c 0019055847$ g++ as.cpp
      |             ^~~~~~~~~~~
a.cc:13:50: warning: multi-character character constant [-Wmultichar]
   13 | as.cpp:31:3: error: use of undeclared identifier 'cin'; did you mean 'sin'?
      |                                                  ^~~~~
a.cc:13:70: warning: multi-character character constant [-Wmultichar]
   13 | as.cpp:31:3: error: use of undeclared identifier 'cin'; did you mean 'sin'?
      |                                                                      ^~~~~
a.cc:17:35: warning: multi-character character constant [-Wmultichar]
   17 | /usr/include/math.h:343:15: note: 'sin' declared here
      |                                   ^~~~~
a.cc:26:50: warning: multi-character character constant [-Wmultichar]
   26 | as.cpp:33:3: error: use of undeclared identifier 'cout'; did you mean
      |                                                  ^~~~~~
a.cc:27:7: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   27 |       'std::cout'?
      |       ^~~~~~~~~~~
a.cc:32:7: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   32 |       'std::cout' declared here
      |       ^~~~~~~~~~~
a.cc:38:51: warning: multi-character character constant [-Wmultichar]
   38 | as.cpp:33:15: error: use of undeclared identifier 'endl'
      |                                                   ^~~~~~
a.cc:42:13: error: invalid digit "9" in octal constant
   42 | pc111089m:c 0019055847$
      |             ^~~~~~~~~~~
a.cc:43:13: error: invalid digit "9" in octal constant
   43 | pc111089m:c 0019055847$ vim as.cpp
      |             ^~~~~~~~~~~
a.cc:44:13: error: invalid digit "9" in octal constant
   44 | pc111089m:c 0019055847$ g++ as.cpp
      |             ^~~~~~~~~~~
a.cc:55:13: error: invalid digit "9" in octal constant
   55 | pc111089m:c 0019055847$ vim as.cpp
      |             ^~~~~~~~~~~
a.cc:56:13: error: invalid digit "9" in octal constant
   56 | pc111089m:c 0019055847$ g++ as.cpp
      |             ^~~~~~~~~~~
a.cc:57:13: error: invalid digit "9" in octal constant
   57 | pc111089m:c 0019055847$ ls
      |             ^~~~~~~~~~~
a.cc:59:13: error: invalid digit "9" in octal constant
   59 | pc111089m:c 0019055847$ ./a.out
      |             ^~~~~~~~~~~
a.cc:71:13: error: invalid digit "9" in octal constant
   71 | pc111089m:c 0019055847$ vim as.cpp
      |             ^~~~~~~~~~~
a.cc:1:1: error: 'Last' does not name a type
    1 | Last login: Wed Apr 27 15:37:25 on console
      | ^~~~
a.cc:13:57: error: 'did' does not name a type
   13 | as.cpp:31:3: error: use of undeclared identifier 'cin'; did you mean 'sin'?
      |                                                         ^~~
a.cc:15:17: error: expected unqualified-id before '^' token
   15 |                 ^~~
      |                 ^
a.cc:19:15: error: expected unqualified-id before '^' token
   19 |               ^
      |               ^
a.cc:22:22: error: expected unqualified-id before '^' token
   22 |                      ^
      |                      ^
a.cc:25:20: error: expected unqualified-id before '^' token
   25 |                    ^
      |                    ^
a.cc:26:58: error: 'did' does not name a type
   26 | as.cpp:33:3: error: use of undeclared identifier 'cout'; did you mean
      |                                                          ^~~
a.cc:29:17: error: expected unqualified-id before '^' token
   29 |                 ^~~~
      |                 ^
a.cc:34:33: error: expected unqualified-id before '^' token
   34 |                                 ^
      |                                 ^
a.cc:37:25: error: expected unqualified-id before '^' token
   37 |                         ^
      |                         ^
a.cc:40:29: error: expected unqualified-id before '^' token
   40 |                             ^
      |                             ^
a.cc:47:22: error: expected unqualified-id before '^' token
   47 |                      ^
      |                      ^
a.cc:50:20: error: expected unqualified-id before '^' token
   50 |                    ^
      |                    ^
a.cc:53:25: error: expected unqualified-id before '^' token
   53 |                         ^
      |                         ^
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:73:
/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;
      |                       ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
  147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                                      ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
  154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
      |                          ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is n