criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
int main(){
int n;
std::cin >> n;
for(int i = 1 ; i <= n ; i++){
    for(int j = 1 ; j <= n ; j++){
      for(int k = 1 ; k <= n ; k++){
        sum += __gcd(__gcd(i,j),k);
      }
    }
  }
  std::cout << sum << std::endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'sum' was not declared in this scope
    8 |         sum += __gcd(__gcd(i,j),k);
      |         ^~~
a.cc:8:22: error: '__gcd' was not declared in this scope
    8 |         sum += __gcd(__gcd(i,j),k);
      |                      ^~~~~
a.cc:8:16: error: '__gcd' was not declared in this scope
    8 |         sum += __gcd(__gcd(i,j),k);
      |                ^~~~~
a.cc:12:16: error: 'sum' was not declared in this scope
   12 |   std::cout << sum << std::endl;
      |                ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int gcd(int a, int b) {
    
    int r = 0;
    int result = 0;
    while(1){
        r = a % b;

        if(r == 0){
            result = a;
            break;
        }

        a = b;
        b = r;
    }

    return 
}

int main(void)
{
    int K;
    int sum;
    for(int i = 1;i <= K;i++){
        for(int j = 1; j <= K;j++){
            for(int l = 1; l <= K;l++){         
                sum += gcd(gcd(i,j),l);
            }        
        }
    }
    cout << sum << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:22:1: error: expected primary-expression before '}' token
   22 | }
      | ^
a.cc:21:11: error: expected ';' before '}' token
   21 |     return
      |           ^
      |           ;
   22 | }
      | ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int gcd(int a, int b) {
    
    int r = 0;
    int result = 0;
    while(1){
        r = a % b;

        if(r == 0){
            result = a;
            break;
        }

        a = b;
        b = r;
    }

    return 
}

int main(void)
{
    int K;
    int sum;
    for(int i = 1;i <= K;i++){
        for(int j = 1; j <= K;j++){
            for(int l = 1; l <= K;l++){         
                sum += gcd(gcd(i,j),l);
        }        
    }
    cout << sum << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:22:1: error: expected primary-expression before '}' token
   22 | }
      | ^
a.cc:21:11: error: expected ';' before '}' token
   21 |     return
      |           ^
      |           ;
   22 | }
      | ~          
a.cc: In function 'int main()':
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:25:1: note: to match this '{'
   25 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int K;
  int S=0;
  cin>>K;
  for(int A=1;A<=K;A++){
    for(int B=1;B<=K;B++){
      for(int C=1;C<=K;C++){
        S+=__gcd(A,B,C)
      }
    }
  }
  cout<<S<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: no matching function for call to '__gcd(int&, int&, int&)'
   11 |         S+=__gcd(A,B,C)
      |            ~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   candidate expects 2 arguments, 3 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int K;
  int S=0;
  cin>>K;
  for(int A=1;A<=K;A++){
    for(int B=1;B<=K;B++){
      for(int C=1;C<=K;C++){
        S+=__gcd(A,B,C);
      }
    }
  }
  cout<<S<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: no matching function for call to '__gcd(int&, int&, int&)'
   11 |         S+=__gcd(A,B,C);
      |            ~~~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   candidate expects 2 arguments, 3 provided
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

ll gcd(ll a, ll b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}

int main() {

    int k;
    cin >> k;
    
    ll ans = 0;
    RREP(i, 1, k+1) [
        RREP(j, 1, k+1) {
            RREP(l, 1, k+1) {
                ans += gcd(gcd(i, j), k);
            }
        }
    ]

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:23: error: expected identifier before 'for'
    3 | #define RREP(i, s, n) for (int i = s; i < (n); i++)
      |                       ^~~
a.cc:28:9: note: in expansion of macro 'RREP'
   28 |         RREP(j, 1, k+1) {
      |         ^~~~
a.cc:3:37: error: expected ']' before ';' token
    3 | #define RREP(i, s, n) for (int i = s; i < (n); i++)
      |                                     ^
a.cc:28:9: note: in expansion of macro 'RREP'
   28 |         RREP(j, 1, k+1) {
      |         ^~~~
a.cc: In lambda function:
a.cc:3:37: error: expected '{' before ';' token
    3 | #define RREP(i, s, n) for (int i = s; i < (n); i++)
      |                                     ^
a.cc:28:9: note: in expansion of macro 'RREP'
   28 |         RREP(j, 1, k+1) {
      |         ^~~~
a.cc: In function 'int main()':
a.cc:28:14: error: 'j' was not declared in this scope
   28 |         RREP(j, 1, k+1) {
      |              ^
a.cc:3:39: note: in definition of macro 'RREP'
    3 | #define RREP(i, s, n) for (int i = s; i < (n); i++)
      |                                       ^
a.cc:33:5: error: expected primary-expression before ']' token
   33 |     ]
      |     ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

ll gcd(ll a, ll b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}

int main() {

    int k;
    cin >> k;
    
    ll ans = 0;
    RREP(i, 1, k+1) [
        RREP(j, 1, k+1) {
            RREP(l, 1, k+1) {
                ans += gcd(i, j, k);
            }
        }
    ]

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:23: error: expected identifier before 'for'
    3 | #define RREP(i, s, n) for (int i = s; i < (n); i++)
      |                       ^~~
a.cc:28:9: note: in expansion of macro 'RREP'
   28 |         RREP(j, 1, k+1) {
      |         ^~~~
a.cc:3:37: error: expected ']' before ';' token
    3 | #define RREP(i, s, n) for (int i = s; i < (n); i++)
      |                                     ^
a.cc:28:9: note: in expansion of macro 'RREP'
   28 |         RREP(j, 1, k+1) {
      |         ^~~~
a.cc: In lambda function:
a.cc:3:37: error: expected '{' before ';' token
    3 | #define RREP(i, s, n) for (int i = s; i < (n); i++)
      |                                     ^
a.cc:28:9: note: in expansion of macro 'RREP'
   28 |         RREP(j, 1, k+1) {
      |         ^~~~
a.cc: In function 'int main()':
a.cc:28:14: error: 'j' was not declared in this scope
   28 |         RREP(j, 1, k+1) {
      |              ^
a.cc:3:39: note: in definition of macro 'RREP'
    3 | #define RREP(i, s, n) for (int i = s; i < (n); i++)
      |                                       ^
a.cc:33:5: error: expected primary-expression before ']' token
   33 |     ]
      |     ^
Language: C++

#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int gcd(int a,int b){
  if(a%b == 0){
    return b;
  }
else{
  return gcd(b, a%b);
}
}


int main(){
	int K;
    cin >> K;
  int sum = 0;
    for(int i=0;i<K;++i){
     for(int j=0;j<K;++j){
       for(int l=0;l<K;++l){
         sum += gcd(gcd(i,j),l)
       }
     }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:32: error: expected ';' before '}' token
   22 |          sum += gcd(gcd(i,j),l)
      |                                ^
      |                                ;
   23 |        }
      |        ~
Language: C++

#include <iostream>
#include <bits/stdc++.h>
using namespace std;


int main(){
	int K;
    cin >> K;
  int sum = 0;
    for(int i=0;i<K;++i){
     for(int j=o;j<K;++j){
       for(int l=0;l<K;++l){
         sum += _gcd(_gcd(i,j),l)
       }
     }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'o' was not declared in this scope
   11 |      for(int j=o;j<K;++j){
      |                ^
a.cc:13:22: error: '_gcd' was not declared in this scope
   13 |          sum += _gcd(_gcd(i,j),l)
      |                      ^~~~
a.cc:13:17: error: '_gcd' was not declared in this scope
   13 |          sum += _gcd(_gcd(i,j),l)
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using Graph = vector<vector<int>>;
using ll = long long;


int x,y;

int gcd(int x, int y){
    if (a%b == 0){
        return(y);
    }
    else{
      return(gcd(y, x%y));
    }
}

int main() {
    int k;
    cin>>k;
    int ans=0;
    rep(a,k){
        rep(b,k){
            rep(c,k){
                ans+=gcd(a,gcd(b,c));
            }
        }
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:12:9: error: 'a' was not declared in this scope
   12 |     if (a%b == 0){
      |         ^
a.cc:12:11: error: 'b' was not declared in this scope
   12 |     if (a%b == 0){
      |           ^
a.cc:18:1: warning: control reaches end of non-void function [-Wreturn-type]
   18 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main()
{ 
  int K;
  int sum = 0;
 cin >> K;
  for(int i = 1; i <= K ; i++){
    for(int j = 1 ; j <= K ; j++){
      for(int k = 1 ; k < = K ; k++){
        sum+=__gcd(i, j, k);
      }
    }
  }
  cout << sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: expected primary-expression before '=' token
   11 |       for(int k = 1 ; k < = K ; k++){
      |                           ^
a.cc:12:19: error: no matching function for call to '__gcd(int&, int&, int&)'
   12 |         sum+=__gcd(i, j, k);
      |              ~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   candidate expects 2 arguments, 3 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
int main()
{
  ll n;
  cin>>n;
  ll sum=0;
  for(ll i=1;i<=n;i++)
    for(ll j=1;j<=n;j++)
      for(ll k=1;k<=n;k++)
        sum+=__gcd(i,__gcd(j,k);
  cout<<sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: expected ')' before ';' token
   13 |         sum+=__gcd(i,__gcd(j,k);
      |                   ~            ^
      |                                )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
	int k; cin >> k;
	int ans = 0;
	rep(i, k){
		rep(j, k){
			rep(K, k){
				ans += gcd(gcd(i+1,j+1),K+1)
			}
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:61: error: expected ';' before '}' token
   11 |                                 ans += gcd(gcd(i+1,j+1),K+1)
      |                                                             ^
      |                                                             ;
   12 |                         }
      |                         ~
Language: Java

import java.util.Scanner;

public class Main {


	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		long a = 1;
		long b = 1;
		long c = 1;
//gvd(a,b,c)のような形にする
		long N = sc.nextLong();
		long total = 0;
		String OK = "";
		//メソッドインスタンス化
		sample gcd1 = new sample();
		//(1,1,1)(1,1,2)の場合を先にしておく。
		total = gcd1.gcd(a,b,c,total);
		if(a == b && b ==c) {
			c += 1;
			total = gcd1.gcd(a,b,c,total);
		}
		//a,b,cの値がNより大きく、かつ全て等しくなるまで回す
			while( OK != "ok") {

			if(c < N) {
					while(c < N) {
						c += 1;
						total = gcd1.gcd(a,b,c,total);

					}
			}else if(b < N) {
				c = c-(N-1);
				while(b < N) {
					b += 1;
					total = gcd1.gcd(a,b,c,total);

				}
			}else{
				b = b-(N-1);
				c = c-(N-1);
				while(a < N) {
					a += 1;
					total = gcd1.gcd(a,b,c,total);

				}
			}
			if(a == b && b ==c) {

				OK = "ok";
			}
		}
		System.out.println(total);
	sc.close();
}
	//最大公約数を求めるメソッド
	public long gcd (long a, long b, long c, long total) {
		long temp = 0;
		while((temp = a%b)!=0) {
			a = b;
			b = temp;
		}
		while((temp = b%c)!=0) {
			b = c;
			c = temp;
		}
		total += c;
		return total;
	}
}


Compiler output:
Main.java:17: error: cannot find symbol
		sample gcd1 = new sample();
		^
  symbol:   class sample
  location: class Main
Main.java:17: error: cannot find symbol
		sample gcd1 = new sample();
		                  ^
  symbol:   class sample
  location: class Main
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class CN {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int k = sc.nextInt();
		long ans = 0l;
		ArrayList<Integer> li = new ArrayList<>();
		for(int i = 1; i <= k; i++) {
			for(int j = 1; j <= k; j++) {
				for(int l = 1; l <= k; l++) {
					int x = gcd3(i, j ,l);
					li.add(x);
					ans += x;
				}
			}
		}
		System.out.println(ans);
	}

	public static int gcd2(int num1, int num2) {
		if(num1 < num2) return gcd2(num2, num1);
		if(num2 == 0) return num1;
		else return gcd2(num2, num1%num2);
	}

	public static int gcd3(int num1, int num2,int num3) {
		int num12 = gcd2(num1, num2);
		return gcd2(num12, num3);
	}

	static class FastScanner {
		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;
	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

	    public long nextLong() {
	        return Long.parseLong(next());
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }

	    public double nextDouble() {
	         return Double.parseDouble(next());
	     }

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }
	}
}


Compiler output:
Main.java:8: error: class CN is public, should be declared in a file named CN.java
public class CN {
       ^
1 error
Language: C++

#include<stdio.h>

int gcd(int a,int b) 
{  
  while(c!=0){
    int c = a%b;
    a=b;
    b=c;
  }
  return a;
}

int main(void) 
{
  int k,i,j,l;
  int wa = 0;
  
  scanf("%d",&k);
  
  for(i=1;i<=k;i++){
    for(j=1;j<=k;j++){
      for(l=1;l<=k;l++){
        wa+=gcd(gcd(i,j),l);
      }
    }
  }
  
  printf("%d",wa);
  return 0;
} 

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:9: error: 'c' was not declared in this scope
    5 |   while(c!=0){
      |         ^
Language: C++

#include<stdio.h>

int gcd(int a,int b) 
{  
  while(d!=0){
    int c = a%b;
    a=b;
    b=c;
  }
  return a;
}

int main(void) 
{
  int k,i,j,l;
  int wa = 0;
  
  for(i=1;i<=k;i++){
    for(j=1;j<=k;j++){
      for(l=1;l<=k;l++){
        wa+=gcd(gcd(i,j),l);
      }
    }
  }
  
  printf("%d",wa);
  return 0;
} 

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:9: error: 'd' was not declared in this scope
    5 |   while(d!=0){
      |         ^
Language: C++

#include<stdio.h>

int gcd(int a,int b) 
{
  while(b!=0){
    int c=a%b;
    a=b;
    b=c;
  }
  return a;
}

int main(void) 
{
  int k,i,j,l;
  int wa = 0;
  
  for(i=1;i<=k;i++){
    for(j=1;j<=k;j++){
      for(l=1;l<=k;l++){
        sum+=gcd(gcd(i,j),l);
      }
    }
  }
  
  printf("%d",wa);
  return 0;
}    

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'sum' was not declared in this scope
   21 |         sum+=gcd(gcd(i,j),l);
      |         ^~~
Language: C++

#include<stdio.h>

int gcd(int a,int b) 
{
  while(b!=0){
    int d=a%b
    a=b;
    b=d;
    d=a%b;
  }
  return a;
}

int main(void) 
{
  int k,i,j,l;
  int sum = 0;
  
  for(i=1;i<=k;i++){
    for(j=1;j<=k;j++){
      for(l=1;l<=k;l++){
        sum+=gcd(gcd(i,j),l);
      }
    }
  }
  
  printf("%d",sum);
  return 0;
}
  
    

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:7:5: error: expected ',' or ';' before 'a'
    7 |     a=b;
      |     ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d=0;
  while(b!=0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int l,i,j,k;
  int sum=0;
  
  scanf("%d", &k);
  
  for(i=1;i<=k;i++) {
    for(j=1;j<=k:j++) {
       for(l=1;l<=k;l++) {
           sum+=gcd(gcd(i,j),l);   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=k:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=k:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'k' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=k:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=k:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C

#include<stdio.h>
 
int main()
{
  int k, i, j, a, b, c, max_d;
  long sum = 0;
  
  scanf("%d", &k);
  
  for(a = 1; a <= k; a++)
  {
    for(b = 1; b <= k; b++)
    {
      for(c = 1; c <= k; c++)
      {
        for(j = 1; j <= 200; j++)
        {
          if(a == b && b == c)    
            max_d = a;
          
          else if(a % j == 0 && b % j == 0 && c % j == 0)
            max_d *= d[j];
        }
        sum += max_d;
        max_d = 1;
      }
    }
  }
  
  printf("%ld", sum);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:22: error: 'd' undeclared (first use in this function)
   22 |             max_d *= d[j];
      |                      ^
main.c:22:22: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d = b%c;
  while(d!=0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int l,i,j,k;
  int sum=0;
  
  scanf("%d", &k);
  
  for(i=1;i<=k;i++) {
    for(j=1;j<=k:j++) {
       for(l=1;l<=k;l++) {
           sum+=gcd(gcd(i,j),l);   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=k:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=k:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'k' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=k:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=k:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d = b%c;
  while(d!=0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int l,i,j,k;
  int sum=0;
  
  scanf("%d", &k);
  
  for(i=1;i<=k;i++) {
    for(j=1;j<=k:j++) {
       for(l=1;l<=k;l++) {
           sum+=gcd(i,gcd(j,l));   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=k:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=k:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'k' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=k:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=k:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include <stdio.h>

int dai(int a, int b, int c)
{
  int ma;
  
  if(a>=b)
    ma = a;
  else
    ma = b;
  if(c>ma)
    ma = c;
  
  return ma;
}
    
int main(void)
{
  int k,i;
  int a,b,c;
  int d,max;
  long int sum = 0;
    
  do{
    scanf("%d",&k);
  } while(k<1 || k>200);
  
  for(a=1;a<=k;a++){
    for(b=1;b<=k;b++){
      for(c=1;c<=k;c++){
        d = dai(a,b,c);
        for(i=1;i<=ma;i++)
          if((a%i == 0 && b%i == 0) && c%i == 0)
            max = i;
        sum += max;
      }
    }
  }
  printf("%ld\n",sum);
  
  return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:32:20: error: 'ma' was not declared in this scope; did you mean 'max'?
   32 |         for(i=1;i<=ma;i++)
      |                    ^~
      |                    max
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d = b%c;
  while(d!=0) {
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  int sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum+=gcd(i,gcd(j,k));   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   21 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:21:17: error: found ':' in nested-name-specifier, expected '::'
   21 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:21:16: error: 'a' is not a class, namespace, or enumeration
   21 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:26:3: error: expected primary-expression before '}' token
   26 |   }
      |   ^
a.cc:25:7: error: expected ';' before '}' token
   25 |      }
      |       ^
      |       ;
   26 |   }
      |   ~    
a.cc:26:3: error: expected primary-expression before '}' token
   26 |   }
      |   ^
a.cc:25:7: error: expected ')' before '}' token
   25 |      }
      |       ^
      |       )
   26 |   }
      |   ~    
a.cc:21:8: note: to match this '('
   21 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:26:3: error: expected primary-expression before '}' token
   26 |   }
      |   ^
Language: C++

#include<stdio.h>

int gcd(int b,int c)
{
  int d=b%c;
  while(d!=0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  long sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum+=gcd(i,gcd(j,k));   
       }
     }
  }

  printf("%ld",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include<stdio.h>

int gcd(int b,int c)
{
  int d = b%c;
  while(d!=0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  int sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum+=gcd(gcd(i,j),k);   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d = b%c;
  while(d!=0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  int sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum+=gcd(i,gcd(j,k));   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C

#include <stdio.h>
 
int main(void)
{
  int k,a,b,c,sum=0,t;
  scanf("%d",&k);
  for(a=1;a<=k;a++)
    for(b=1;b<=k;b++)
      for(c=1;c<=k;c++){
        t=c;
        do{
          if((a%t==0) && (b%t==0) && (c%t==0))
            sum+=t;
          else
            t--;
        }while(!((a%t==0) && (b%t==0) && (c%t==0)))
      }
  printf("%d",sum);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:52: error: expected ';' before '}' token
   16 |         }while(!((a%t==0) && (b%t==0) && (c%t==0)))
      |                                                    ^
      |                                                    ;
   17 |       }
      |       ~                                             
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d=0;
  while(b%c!=0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  int sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum+=gcd(i,gcd(j,k));   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C

#include <stdio.h>
 
int main(void)
{
  int k,a,b,c,sum=0,t;
  scanf("%d",&k);
  for(a=1;a<=k;a++)
    for(b=1;b<=k;b++)
      for(c=1;c<=k;c++){
        t=c;
        do{
          if((a%t==0) && (b%t==0) && (c%t==0))
            sum+=t;
          else
            t--;
        }while!((a%t==0) && (b%t==0) && (c%t==0))
      }
  printf("%d",sum);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:15: error: expected '(' before '!' token
   16 |         }while!((a%t==0) && (b%t==0) && (c%t==0))
      |               ^
      |               (
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d=0;
  while(b%c!=0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  int sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum=sum+gcd(i,gcd(j,k));   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d=0;
  while(b%c!==0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  int sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum+=gcd(i,gcd(j,k));   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:14: error: expected primary-expression before '=' token
    6 |   while(b%c!==0) {
      |              ^
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C

#include <stdio.h>

int main(void)
{
  int kys = 0;
  int goukei = 0;
  scanf("%d",&n);
  for(int i=1; i<=n; i++){
    for(int j=1; j<=n; j++){
      for(int k=1; k<=n; k++){
        for(int wari=1; wari<=n; wari++){
          if(i%wari==0 && j%wari==0 && k%wari==0)
            kys = wari;
        }
        goukei += kys;
      }
    }
  }
  printf("%d",goukei);
  return 0;
}          

Compiler output:
main.c: In function 'main':
main.c:7:15: error: 'n' undeclared (first use in this function)
    7 |   scanf("%d",&n);
      |               ^
main.c:7:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d=0;
  while(b%c!==0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  long sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum=sum+gcd(i,gcd(j,k));   
       }
     }
  }

  printf("%ld",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:14: error: expected primary-expression before '=' token
    6 |   while(b%c!==0) {
      |              ^
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d=0;
  while(b%c!==0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  int sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum=sum+gcd(i,gcd(j,k));   
       }
     }
  }

  printf("%d",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:14: error: expected primary-expression before '=' token
    6 |   while(b%c!==0) {
      |              ^
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ';' before '}' token
   26 |      }
      |       ^
      |       ;
   27 |   }
      |   ~    
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:7: error: expected ')' before '}' token
   26 |      }
      |       ^
      |       )
   27 |   }
      |   ~    
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d;
  while(b%c!==0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  long sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum=sum+gcd(i,gcd(j,k));   
       }
    }
  }

  printf("%ld",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:14: error: expected primary-expression before '=' token
    6 |   while(b%c!==0) {
      |              ^
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:6: error: expected ';' before '}' token
   26 |     }
      |      ^
      |      ;
   27 |   }
      |   ~   
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
a.cc:26:6: error: expected ')' before '}' token
   26 |     }
      |      ^
      |      )
   27 |   }
      |   ~   
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:27:3: error: expected primary-expression before '}' token
   27 |   }
      |   ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  int d;
  while(b%c!==0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  long sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum=sum+gcd(i,gcd(j,k));   
  }

  printf("%ld",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:6:14: error: expected primary-expression before '=' token
    6 |   while(b%c!==0) {
      |              ^
a.cc: In function 'int main()':
a.cc:22:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   22 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:22:17: error: found ':' in nested-name-specifier, expected '::'
   22 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:22:16: error: 'a' is not a class, namespace, or enumeration
   22 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:30:2: error: expected primary-expression at end of input
   30 | }
      |  ^
a.cc:30:2: error: expected ';' at end of input
   30 | }
      |  ^
      |  ;
a.cc:30:2: error: expected primary-expression at end of input
a.cc:30:2: error: expected ')' at end of input
   30 | }
      |  ^
      |  )
a.cc:22:8: note: to match this '('
   22 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:30:2: error: expected statement at end of input
   30 | }
      |  ^
a.cc:30:2: error: expected '}' at end of input
a.cc:21:21: note: to match this '{'
   21 |   for(i=1;i<=a;i++) {
      |                     ^
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:15:1: note: to match this '{'
   15 | {
      | ^
Language: C++

#include <stdio.h>

int gcd(int b,int c)
{
  while(b%c!==0) {
    d = b%c;
    b = c;
    c = d;
  }
  return b;
}

int main(void)
{
  int a,i,j,k;
  long sum=0;
  
  scanf("%d", &a);
  
  for(i=1;i<=a;i++) {
    for(j=1;j<=a:j++) {
       for(k=1;k<=a;k++) {
           sum=sum+gcd(i,gcd(j,k));   
  }

  printf("%ld",sum);
  
  return 0;
}

Compiler output:
a.cc: In function 'int gcd(int, int)':
a.cc:5:14: error: expected primary-expression before '=' token
    5 |   while(b%c!==0) {
      |              ^
a.cc:6:5: error: 'd' was not declared in this scope
    6 |     d = b%c;
      |     ^
a.cc: In function 'int main()':
a.cc:21:13: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   21 |     for(j=1;j<=a:j++) {
      |             ^
a.cc:21:17: error: found ':' in nested-name-specifier, expected '::'
   21 |     for(j=1;j<=a:j++) {
      |                 ^
      |                 ::
a.cc:21:16: error: 'a' is not a class, namespace, or enumeration
   21 |     for(j=1;j<=a:j++) {
      |                ^
a.cc:29:2: error: expected primary-expression at end of input
   29 | }
      |  ^
a.cc:29:2: error: expected ';' at end of input
   29 | }
      |  ^
      |  ;
a.cc:29:2: error: expected primary-expression at end of input
a.cc:29:2: error: expected ')' at end of input
   29 | }
      |  ^
      |  )
a.cc:21:8: note: to match this '('
   21 |     for(j=1;j<=a:j++) {
      |        ^
a.cc:29:2: error: expected statement at end of input
   29 | }
      |  ^
a.cc:29:2: error: expected '}' at end of input
a.cc:20:21: note: to match this '{'
   20 |   for(i=1;i<=a;i++) {
      |                     ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:14:1: note: to match this '{'
   14 | {
      | ^
Language: C++

#include <stdio.h>
int gcd(int x,int y,int z){
while(x%y!=0)
  int c;
  c=z;
{
 z=x%y;
  x=y;
  y=z;
}
  while(c%y!=0)
  {
    z=c%y;
    c=y;
    y=z;
  }
  return y;
}

int main (void)
{
  int max,sum=0,a,b,c,k,n;
  scanf("%d",&k);
  for(a=1;a<=k;a++){
    for(b=1;b<=k;b++){
      for(c=1;c<=k;c++){
        n=gcd(a,b,c);
        sum+=n;
      }
    }
  }
  printf("%d",sum);
  return 0;
}
  

Compiler output:
a.cc: In function 'int gcd(int, int, int)':
a.cc:5:3: error: 'c' was not declared in this scope
    5 |   c=z;
      |   ^
Language: C

#include <stdio.h>
 
int main(void)
{
  int k,a,b,c,sum=0;
  scanf("%d",&k);
  int max[k][k][k]={{{0,0},{0,0}},{{0,0},{0,0}}};
  for(a=1;a<=k;a++)
    for(b=1;b<=k;b++)
      for(c=1;c<=k;c++)
        if((a%c==0) && (b%c==0))
          max[a][b][c]=c;
  for(a=1;a<=k;a++)
    for(b=1;b<=k;b++)
      for(c=1;c<=k;c++)
        sum+=max[a][b][c];
  printf("%d",sum);
  
  return 0;
}
#include <stdio.h>
 
int main(void)
{
  int k,a,b,c,sum=0;
  scanf("%d",&k);
  int max[k][k][k];
  for(a=1;a<=k;a++)
    for(b=1;b<=k;b++)
      for(c=1;c<=k;c++)
        max[a][b][c]=0;
  for(a=1;a<=k;a++)
    for(b=1;b<=k;b++)
      for(c=1;c<=k;c++)
        if((a%c==0) && (b%c==0))
          max[a][b][c]=c;
  for(a=1;a<=k;a++)
    for(b=1;b<=k;b++)
      for(c=1;c<=k;c++)
        sum+=max[a][b][c];
  printf("%d",sum);
  
  return 0;
}
提出情報 

Compiler output:
main.c: In function 'main':
main.c:7:20: error: variable-sized object may not be initialized except with an empty initializer
    7 |   int max[k][k][k]={{{0,0},{0,0}},{{0,0},{0,0}}};
      |                    ^
main.c: At top level:
main.c:23:5: error: redefinition of 'main'
   23 | int main(void)
      |     ^~~~
main.c:3:5: note: previous definition of 'main' with type 'int(void)'
    3 | int main(void)
      |     ^~~~
main.c:45:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   45 | 提出情報
      | ^~~~~~~~