Language: C

Last login: Sun Apr 12 20:10:07 on ttys012

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
masudayuuyanoMacBook-Pro:~ masudayuuya$ cd atcoder
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ls
#welcome.c#		divide.c		goldencoins1.c
PlacingMarbles		divide1			goldencoins1.c~
PlacingMarbles.c	divide1.c		lucky7
Product			division		lucky7.c
Product.c		division.c		ordinary
a			division.c~		ordinary.c
a.c			dodecagon		placing
airplane		dodecagon.c		replacing
airplane.c		exception		replacing.c
anti			exception.c		replacing.c~
anti.c			exception.c~		replacing2
anti.c~			ferris			replacing2.c
ball			ferris.c		replacing2.c~
ball.c			fizz			rounding
bire			fizz.c			rounding.c
bite			golden			security
bite.c			golden.c		security.c
bounding.c		golden.c~		sum
coffee			goldencoins		sum.c
coffee.c		goldencoins.c		sum.c~
coffee.c~		goldencoins.c~		welcome
divide			goldencoins1		welcome.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs gcd.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./sum
2
8masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc sum.c -o sum
sum.c:44:15: error: use of undeclared identifier 'l'
  for(int i=K;l++){
              ^
sum.c:45:22: error: use of undeclared identifier 'j'
        sum += gcd(i,j,l);
                     ^
sum.c:45:24: error: use of undeclared identifier 'l'
        sum += gcd(i,j,l);
                       ^
sum.c:48:3: error: extraneous closing brace ('}')
  }
  ^
sum.c:49:10: error: expected parameter declarator
  printf("%d",sum);
         ^
sum.c:49:10: error: expected ')'
sum.c:49:9: note: to match this '('
  printf("%d",sum);
        ^
sum.c:49:3: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  printf("%d",sum);
  ^
sum.c:49:3: error: conflicting types for 'printf'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:170:6: note: 
      previous declaration is here
int      printf(const char * __restrict, ...) __printflike(1, 2);
         ^
sum.c:50:3: error: expected identifier or '('
  return 0;
  ^
sum.c:51:1: error: extraneous closing brace ('}')
}
^
1 warning and 9 errors generated.
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc sum.c -o sum
sum.c:51:10: error: expected parameter declarator
  printf("%d",sum);
         ^
sum.c:51:10: error: expected ')'
sum.c:51:9: note: to match this '('
  printf("%d",sum);
        ^
sum.c:51:3: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  printf("%d",sum);
  ^
sum.c:51:3: error: conflicting types for 'printf'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:170:6: note: 
      previous declaration is here
int      printf(const char * __restrict, ...) __printflike(1, 2);
         ^
sum.c:52:3: error: expected identifier or '('
  return 0;
  ^
sum.c:53:1: error: extraneous closing brace ('}')
}
^
1 warning and 5 errors generated.
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc sum.c -o sum
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./sum
2
8masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./
-bash: ./: is a directory
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./sum
3
27masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc sum.c -o sum
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./sum
2
15masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc sum.c -o sum
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./sum
2
9masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./sum
3
30masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs fizz.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc fizz.c -o fizz
fizz.c:7:21: error: expected ')'
    if((i+1)%15 != 0{
                    ^
fizz.c:7:7: note: to match this '('
    if((i+1)%15 != 0{
      ^
1 error generated.
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs fizz.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc fizz.c -o fizz
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ less fizz.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./sum
200
-1050018460masudayuuyanoMacBook-Pro:atcoder masudayuuya$ 
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs fizz.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc fizz.c -o fizz
fizz.c:7:16: error: expression is not assignable
    if((i+1)%3 = 0 || (i+1)%5 == 0){
       ~~~~~~~ ^
1 error generated.
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs fizz.c
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ gcc fizz.c -o fizz
masudayuuyanoMacBook-Pro:atcoder masudayuuya$ less fizz.c

#include <stdio.h>
int main(void){
  int N;
  scanf("%d",&N);
  int a[N];int sum=0;
  for(int i=0;i<N;i++){
    if((i+1)%3 == 0 || (i+1)%5 == 0){
      a[i]=0;
    } else{
      a[i]=i+1;
    }
  sum += a[i];
  }
  printf("%d",sum);
  return 0;
}









Compiler output:
main.c:1:1: error: unknown type name 'Last'
    1 | Last login: Sun Apr 12 20:10:07 on ttys012
      | ^~~~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    1 | Last login: Sun Apr 12 20:10:07 on ttys012
      |           ^
main.c:4:47: error: stray '`' in program
    4 | To update your account to use zsh, please run `chsh -s /bin/zsh`.
      |                                               ^
main.c:4:64: error: stray '`' in program
    4 | To update your account to use zsh, please run `chsh -s /bin/zsh`.
      |                                                                ^
main.c:8:2: error: invalid preprocessing directive #welcome
    8 | #welcome.c#             divide.c                goldencoins1.c
      |  ^~~~~~~
main.c:34:1: error: invalid suffix "masudayuuyanoMacBook" on integer constant
   34 | 8masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
      | ^~~~~~~~~~~~~~~~~~~~~
main.c:37:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   37 |   for(int i=K;l++){
      |                ^~
main.c:47:3: error: expected identifier or '(' before '^' token
   47 |   ^
      |   ^
main.c:50:10: error: expected identifier or '(' before '^' token
   50 |          ^
      |          ^
main.c:54:9: error: expected identifier or '(' before '^' token
   54 |         ^
      |         ^
main.c:55:58: warning: multi-character character constant [-Wmultichar]
   55 | sum.c:49:3: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
      |                                                          ^~~~~
main.c:57:3: error: expected identifier or '(' before '^' token
   57 |   ^
      |   ^
main.c:58:42: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   58 | sum.c:49:3: error: conflicting types for 'printf'
      |                                          ^~~~~~~~
main.c:62:10: error: expected identifier or '(' before '^' token
   62 |          ^
      |          ^
main.c:65:3: error: expected identifier or '(' before '^' token
   65 |   ^
      |   ^
main.c:68:1: error: expected identifier or '(' before '^' token
   68 | ^
      | ^
main.c:74:10: error: expected identifier or '(' before '^' token
   74 |          ^
      |          ^
main.c:78:9: error: expected identifier or '(' before '^' token
   78 |         ^
      |         ^
main.c:79:58: warning: multi-character character constant [-Wmultichar]
   79 | sum.c:51:3: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
      |                                                          ^~~~~
main.c:81:3: error: expected identifier or '(' before '^' token
   81 |   ^
      |   ^
main.c:82:42: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
   82 | sum.c:51:3: error: conflicting types for 'printf'
      |                                          ^~~~~~~~
main.c:86:10: error: expected identifier or '(' before '^' token
   86 |          ^
      |          ^
main.c:89:3: error: expected identifier or '(' before '^' token
   89 |   ^
      |   ^
main.c:92:1: error: expected identifier or '(' before '^' token
   92 | ^
      | ^
main.c:98:1: error: invalid suffix "masudayuuyanoMacBook" on integer constant
   98 | 8masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./
      | ^~~~~~~~~~~~~~~~~~~~~
main.c:102:1: error: invalid suffix "masudayuuyanoMacBook" on integer constant
  102 | 27masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
      | ^~~~~~~~~~~~~~~~~~~~~~
main.c:106:1: error: invalid suffix "masudayuuyanoMacBook" on integer constant
  106 | 15masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
      | ^~~~~~~~~~~~~~~~~~~~~~
main.c:110:1: error: invalid suffix "masudayuuyanoMacBook" on integer constant
  110 | 9masudayuuyanoMacBook-Pro:atcoder masudayuuya$ ./sum
      | ^~~~~~~~~~~~~~~~~~~~~
main.c:112:1: error: invalid suffix "masudayuuyanoMacBook" on integer constant
  112 | 30masudayuuyanoMacBook-Pro:atcoder masudayuuya$ emacs sum.c
      | ^~~~~~~~~~~~~~~~~~~~~~
main.c:129:2: error: invalid suffix "masudayuuyanoMacBook" on integer constant
  129 | -1050018460masudayuuyanoMacBook-Pro:atcoder masudayuuya$
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~