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

#include<stdio.h>
using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:50: error: 'cin' was not declared in this scope
    2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
      |                                                  ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
a.cc:2:135: error: 'cout' was not declared in this scope
    2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
      |                                                                                                                                       ^~~~
a.cc:2:135: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:2:147: error: 'endl' was not declared in this scope
    2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
      |                                                                                                                                                   ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<stdio.h>
  +++ |+#include <ostream>
    2 | using namespace std;int g[89];int main(){int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=1;i<=n;i++)cout<<g[i]<<endl;}
Language: C++

#include <ios>
using namespace std;
int g[55];
main()
{
  int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:11: error: 'cin' was not declared in this scope
    6 |   int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
      |           ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <ios>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:6:94: error: 'cout' was not declared in this scope
    6 |   int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
      |                                                                                              ^~~~
a.cc:6:94: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:106: error: 'endl' was not declared in this scope
    6 |   int n,m;cin>>n>>m;for(int i=0;i<m;i++){int a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
      |                                                                                                          ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <ios>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
int g[89];
main(int)
{
   n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(int)
      | ^~~~
a.cc:4:1: warning: 'int main(int)' takes only zero or two arguments [-Wmain]
a.cc: In function 'int main(int)':
a.cc:6:4: error: 'n' was not declared in this scope
    6 |    n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
      |    ^
a.cc:6:6: error: 'm' was not declared in this scope; did you mean 'tm'?
    6 |    n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
      |      ^
      |      tm
a.cc:6:40: error: 'a' was not declared in this scope
    6 |    n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
      |                                        ^
a.cc:6:42: error: 'b' was not declared in this scope
    6 |    n,m;cin>>n>>m;for(int i=0;i<m;i++){ a,b;cin>>a>>b;g[a]++;g[b]++;}for(int i=0;i++<n;)cout<<g[i]<<endl;
      |                                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N , M;
  cin >> N, M; 
  vector<int> A;
  vector<int> B;
   for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:4: error: expected '}' at end of input
   11 |   }
      |    ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
    int n = Integer.parseInt(sc.next());
    int m = Integer.parseInt(sc.next());
int[] a=new int[m];
int[] b=new int[m];
HashMap<Integer,Integer> map=new HashMap<>();
for (int i = 0; i < m; i++) {
    a[i]=Integer.parseInt(sc.next());
    b[i]=Integer.parseInt(sc.next());
}
    for (int i = 0; i < m; i++) {
        map.put(a[i], 0);
        map.put(b[i], 0);
    }
    for (int i = 0; i < m; i++) {
        int c=map.get(a[i])++;
        map.put(a[i], c);
        c=map.get(b[i])++;
        map.put(b[i], c);
    }
    for (int i = 1; i <= n; i++) {
        out.println(map.get(i));
    }
}
}


Compiler output:
Main.java:21: error: unexpected type
        int c=map.get(a[i])++;
                     ^
  required: variable
  found:    value
Main.java:23: error: unexpected type
        c=map.get(b[i])++;
                 ^
  required: variable
  found:    value
2 errors
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N,M;
  cin >> N >> M;
  int a[2];
  int sum[N] = 0;
  for(int i=0;i < M;i++){
    cin >> a[0] >> a[1];
    sum[a[0]]++;
    sum[a[1]]++;
  }
  REP(i,N) cout << sum[i] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:16: error: array must be initialized with a brace-enclosed initializer
   26 |   int sum[N] = 0;
      |                ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int N, M;
  int a[110];
  multiset<int> st;
  
  for(int i = 0; i < 2*M; i += 2){
    cin >> a[i];
    st.insert(a[i]);
  }
  for(int i = 0; i < N)
    cout << st.count(i+1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'multiset' was not declared in this scope
    7 |   multiset<int> st;
      |   ^~~~~~~~
a.cc:2:1: note: 'std::multiset' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    1 | #include<iostream>
  +++ |+#include <set>
    2 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |   multiset<int> st;
      |            ^~~
a.cc:11:5: error: 'st' was not declared in this scope; did you mean 'std'?
   11 |     st.insert(a[i]);
      |     ^~
      |     std
a.cc:13:23: error: expected ';' before ')' token
   13 |   for(int i = 0; i < N)
      |                       ^
      |                       ;
a.cc:14:13: error: 'st' was not declared in this scope; did you mean 'std'?
   14 |     cout << st.count(i+1) << endl;
      |             ^~
      |             std
Language: C++

#include <iostream>

using namespace std;

int main()
{
  int n, m; cin >> n >> m;
  int cnt[n + 1];
  // 初期化
  for (int i = 1; i <= n; i++) cnt[i] = 0;

  for (int i = 1; i <= m; i++) {
    int a = 0
    int b = 0;
    cin >> a >> b;
    cnt[a] += 1;
    cnt[b] += 1;
  }

  for (int i = 1; i <= n; i++) {
    if (cnt[i] != 0) cout << cnt[i] << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected ',' or ';' before 'int'
   14 |     int b = 0;
      |     ^~~
a.cc:15:17: error: 'b' was not declared in this scope
   15 |     cin >> a >> b;
      |                 ^
Language: C++

#include "stdafx.h"
#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#define INT_MAX 2147483647
#define LLINT_MAX 9223372036854775807
#define mod 1000000007
#define ll long long int
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	int a, b;
	int ans[50];
	for (int i = 0; i < 50; i++)
		ans[i] = 0;
	for (int i = 0; i < m; i++) {
		cin >> a >> b;
		ans[a - 1]++;
		ans[b - 1]++;
	}
	for (int i = 0; i < n; i++)
		cout << ans[i] << endl;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

using namespace std;

int main() {
  int N, M, a, b;
  cin >> N >> M;

  for (int n = 1; n < N + 1; n++){
    int sum = 0;
    //N = pの個数のカウント
    //以下で各行ごとに調べる
    for (int j = 0; j < M; j++){
      cin >> a >> b; //行のa, bの入力
      //a, bがNに等しいか否かの判定
      if (n == a && n == b){
        sum += 2;
      }
      else if (n == a && n != b){
        sum += 1;
      }
      else if (n != a && n == b){
        sum += 1;
      }
      else{
        continue;
      }
    }
  cout << sum << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> N >> M;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << sum << endl;
      |   ^~~~
a.cc:27:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:18: error: 'endl' was not declared in this scope
   27 |   cout << sum << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

int main() {
  int N, M, a, b, sum = 0;
  cin >> N >> M;

  for (int i = 1; i < N + 1; i++){ 
    /*全体に対してi = a or i = bの個数を探索.
    iはN、つまり都市数*/
    for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数
      cin >> a >> b;
      vector<int>city;
      city = {a, b};
      for (int k = 0; k < 2; k++){ //配列の各要素についてiを探索
        if (i == city(k)){
          sum += 1;
        }
        else{
          continue;
        }
      }
    }
  cout << sum << endl;
  sum = 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: no match for call to '(std::vector<int>) (int&)'
   16 |         if (i == city(k)){
      |                  ~~~~^~~
Language: C++

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

int main() {
  int N, M, a, b, sum = 0;
  cin >> N >> M;

  for (int i = 1; i < N + 1; i++){ 
    /*全体に対してi = a or i = bの個数を探索.
    iはN、つまり都市数*/
    for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数
      cin >> a >> b;
      vector<int>city;
      city = {a, b};
      for (int k = 0; k < 2; k++){ //配列の各要素についてiを探索
        if (i == city(k)){
          sum += 1;
        }
        else{
          continue;
        }
      }
  cout << sum << endl;
  sum = 0;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: no match for call to '(std::vector<int>) (int&)'
   16 |         if (i == city(k)){
      |                  ~~~~^~~
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int N, M, a, b, sum = 0;
  cin >> N >> M;

  for (int i = 1; i < N + 1; i++){ 
    /*全体に対してi = a or i = bの個数を探索.
    iはN、つまり都市数*/
    for(int j = 0; j < M; j++){ //各行でi = a or i = bの個数を探索, jは行数
      cin >> a >> b;
      vector<int>city;
      city = {a, b} //配列に各行のa, bを代入

      for(k = 0; k < 2; k++){
        if (i = city.at(k)){ //配列の先頭から探索.kは配列の番号
          sum += 1;
        }
        else{
          continue;
        }
      } // 各要素の探索終わり
    } //各行の探索処理終わり
  cout << sum << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before 'for'
   14 |       city = {a, b} //配列に各行のa, bを代入
      |                    ^
      |                    ;
   15 | 
   16 |       for(k = 0; k < 2; k++){
      |       ~~~           
a.cc:16:18: error: 'k' was not declared in this scope
   16 |       for(k = 0; k < 2; k++){
      |                  ^
Language: C

#include <iostream>
#include <cstring>

int main()
{
	int n, m;
	std::cin >> n >> m;

	int r[ n ];
	std::memset( r, 0, sizeof( r ) );

	for( int i = 0; i < m; i++ ) {
		int a, b;
		std::cin >> a >> b;

		r[ a - 1 ] += 1;
		r[ b - 1 ] += 1;
	}

	for( int i = 0; i < n; i++ ) {
		std::cout << r[ i ] << std::endl;
	}
	
	return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

int main(void){
    int n,m;
    int a[55],b[55];
    cin >> n >> m;
    for(int i=0 ; i<m ; i++){
        cin >> a[i] >>b[i];
    a[i] -= 1;
    b[i] -= 1;
    }
    int ans[55];
    for(int  i = 0 ; i < n ; i++){ 
        for(int j = 0 ; j < m ; i++){
            if(a[j] == i|| b[j] == i){
                ans[i] += 1;
            }
        }
    }
    for(int i = 0; i < n; i++){
        cout << ans[i] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> n >> m;
      |     ^~~
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << ans[i] << endl;
      |         ^~~~
a.cc:19:27: error: 'endl' was not declared in this scope
   19 |         cout << ans[i] << endl;
      |                           ^~~~
Language: Java

import java.util.*;
public class Main {
public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N,M;
    N=sc.nextInt();
    M=sc.nextInt();
    int [] num_road = new int[N];
    for(int a=0;a<M;a++){
        int a_city =sc.nextInt();
        int b_city =sc.nextInt();
        num_road[a_city-1]++;
        num_road[b_city-1]++;
    }
    for(int b=0;b<N;b++){
        System.out.println(num_road[b]);
    }

}

Compiler output:
Main.java:19: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int m,n;
cin>>n,m;
vector<int>ab(2*m);
vector<int>num(n);

for(int i=0;i<n;i++){
  num.at(i)=0;

for(int i=0;i<2*m;i++){
  cin>>ab.at(i);
  int t=ab.at(i)-1;
  num.at(t)++;
  }

for(int i=0;i<n;i++){
  cout<<num.at(i)<<endl;
  }

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int m,n;
cin>>n,m;
vector<int>ab(2*m);
vector<int>num(n);

for(int i=0;i<n;i++){
  num(i)=0;

for(int i=0;i<2*m;i++){
  cin>>ab.at(i);
  int t=ab.at(i)-1;
  num.at(t)++;
  }

for(int i=0;i<n;i++){
  cout<<num.at(i)<<endl;
  }

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: no match for call to '(std::vector<int>) (int&)'
   10 |   num(i)=0;
      |   ~~~^~~
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int m,n;
cin>>n,m;
vector<int>ab(2*m);
vector<int>num(n);

for(int i=0;i<2*m;i++){
  cin>>ab.at(i);
  num(ab.at(i))++;
  }

for(int i=0;i<n;i++){
  cout<<num.at(i)<<endl/;
  }


return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   11 |   num(ab.at(i))++;
      |   ~~~^~~~~~~~~~
a.cc:15:25: error: expected primary-expression before ';' token
   15 |   cout<<num.at(i)<<endl/;
      |                         ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n,m,a,b;
  cin>>n>>m;

  vector<int> road(n,0);
  for(int i=0;i<m;i++)
  {
    cin>>a>>b;
    road.at(a-1)++;
    road.at(b-1)++;
  }

  for(int i=0;i<n;i++)
  {
    cout<<road.at(i)<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> road(n,0);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> road(n,0);
      |          ^~~
a.cc:13:5: error: 'road' was not declared in this scope
   13 |     road.at(a-1)++;
      |     ^~~~
a.cc:19:11: error: 'road' was not declared in this scope
   19 |     cout<<road.at(i)<<endl;
      |           ^~~~
Language: C++

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

int main() {
  int N,M;
  cin >> N >> M;
  int city[N]
  for(int i = 0;i < 2 * M;i++){
    int a,b;
    cin >> a >> b;
    city[a - 1]++;
    city[b - 1]++;
  }
  for(int i = 0;i < N;i++){
    cout << city[i];
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'for'
    8 |   for(int i = 0;i < 2 * M;i++){
      |   ^~~
a.cc:8:17: error: 'i' was not declared in this scope
    8 |   for(int i = 0;i < 2 * M;i++){
      |                 ^
a.cc:15:13: error: 'city' was not declared in this scope
   15 |     cout << city[i];
      |             ^~~~
Language: C++

#include <iostream>
#include <climits>
#include <stack>
#include <queue>
#include <string>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<int> G[100005];
std::vector<P> tree[100010];
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
#define p(x) cout<<x<<endl;
#define pe(x) cout<<x<<" ";
 
ll i,j,k,l,ii,jj;
ll n,m;
ll x,y;
ll used[200005];
char s[305][305];
ll ans=0;
ll v=-1,w;

int main(){
	int n,m;
	int x,y;
	cin>>n>>m;
	int a[55];
	for(i=0;i<=n;i++){
		a[i]=0;
	}
	for(i=0;i<m;i++){
		cin>>x>>y;
		a[x]+=1;
		a[y]+=1;
	}
	for(i=1;i<=n;i++){
		pe(a[i]);
	}
	p();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:21: error: expected primary-expression before '<<' token
   28 | #define p(x) cout<<x<<endl;
      |                     ^~
a.cc:55:9: note: in expansion of macro 'p'
   55 |         p();
      |         ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
using namespace std;

int main (void) {
  int N, M;
  int ans =0;
  cin >> N >> M;
  int A[N][N]={0};
  for (int i=0; i<=M-1;i++){
    cin >> a >> b;
    A[a][b]=1;
    A[b][a]=1;
  }
  for (int j=0; j<=N-1; j++) {
    for (int k=0; k<=N-1; k++){
      if (A[j][k]== 1 ){
        ans++;
      }
    }
    cout << ans << endl;
    ans=0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'a' was not declared in this scope
   14 |     cin >> a >> b;
      |            ^
a.cc:14:17: error: 'b' was not declared in this scope
   14 |     cin >> a >> b;
      |                 ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int main(){
    int N,M;
    cin >> N >> M;
    vector<int> vc(N);
    for(int i=0;i<M;i++){
        cin >> a >> b;
        vc[a-1]++;
        vc[b-1]++;
    }
    for(int i=0;i<vc.size();i++){
        cout << vc[i] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'a' was not declared in this scope
   12 |         cin >> a >> b;
      |                ^
a.cc:12:21: error: 'b' was not declared in this scope
   12 |         cin >> a >> b;
      |                     ^
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  int M = sc.nextInt();
  int[] a = new int[M]:
  int[] b = new int[M];
  for(int i = 0;i < M;i++){
    a[i] = sc.nextInt();
    b[i] = sc.nextIny();
  }
  for(int i = 0;i < N;i++){
    int ans = 0;
    for(int j = 0;j < M;j++){
      if(a[j] == i+1)ans++;
      if(b[j] == 1+1)ans++;
    }
    System.out.println(ans);
  }
}}

Compiler output:
Main.java:7: error: ';' expected
  int[] a = new int[M]:
                      ^
1 error
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int ab;
		int[] road = new int[n+1];
		for(int i = 0;i<m*2;i++) {
			ab = sc.nextInt();
			road[ab-1] =road[ab-1]+1;
		}
		for(int i = 0;i < n;i++) {
			System.out.println(road[i]);
		}
	}


Compiler output:
Main.java:18: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include <algorithm>
#include <iostream>
using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int a[M], b[M];
	for(int i=0; i<M; i++){
		cin >> a[i] >> b[i];
	}
	for(int i=0; i<N; i++){
		cout << count(a,a+M,i) + count(b,b+M,i) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <algorithm>
#include <iostream>
using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int a[M], b[M];
	for(int i=0; i<M; i++){
		cin >> a[i] >> b[i];
	}
	for(int i=0; i<N; i++){
		cout << count(a,i) + count(b,i) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:30: error: no matching function for call to 'count(int [M], int&)'
   13 |                 cout << count(a,i) + count(b,i) << endl;
      |                         ~~~~~^~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note:   candidate expects 4 arguments, 2 provided
a.cc:13:43: error: no matching function for call to 'count(int [M], int&)'
   13 |                 cout << count(a,i) + count(b,i) << endl;
      |                                      ~~~~~^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note:   candidate expects 4 arguments, 2 provided
a.cc:14:2: error: expected '}' at end of input
   14 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int cnt[100];
int N, K;
int main() {
  cin >> N >> K:
  for(int i = 0; i < K; ++i) {
    int a, b;
    cin >> a >> b;
    --a; --b;
    cnt[a]++;
    cnt[b]++;
  }
  for(int i = 0; i < N; ++i) {
    cout << cnt[i] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected ';' before ':' token
    7 |   cin >> N >> K:
      |                ^
      |                ;
a.cc:8:18: error: 'i' was not declared in this scope
    8 |   for(int i = 0; i < K; ++i) {
      |                  ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
	int n,m,i,j;
	cin>>n>>m;
	int a[55],p,q;
	FOR(i,0,m){
		cin>>p>>q;
		a[p]++;
		a[q]++;
	}
	FOR(i,n+1){
		cout<<a[i]<<endl;
	}
    return 0;
}


Compiler output:
a.cc:47:18: error: macro "FOR" requires 3 arguments, but only 2 given
   47 |         FOR(i,n+1){
      |                  ^
a.cc:22:9: note: macro "FOR" defined here
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:47:9: error: 'FOR' was not declared in this scope
   47 |         FOR(i,n+1){
      |         ^~~
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int a,b,c,f=0;
	cin>>a>>b;
	multi_set<int>s[100];
	r(i,b){
		cin>>c>>f;
		s[c].insert(f);
		s[f].insert(c);
	}
	r(i,a)cout<<s[i+1].size()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'multi_set' was not declared in this scope
    7 |         multi_set<int>s[100];
      |         ^~~~~~~~~
a.cc:7:19: error: expected primary-expression before 'int'
    7 |         multi_set<int>s[100];
      |                   ^~~
a.cc:10:17: error: 's' was not declared in this scope
   10 |                 s[c].insert(f);
      |                 ^
a.cc:13:21: error: 's' was not declared in this scope
   13 |         r(i,a)cout<<s[i+1].size()<<endl;
      |                     ^
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int a,b,c,f=0;
	cin>>a>>b;
	set<int>s[100];
	r(i,m){
		cin>>c>>f;
		s[c].insert(f);
		s[f].insert(c);
	}
	r(i,n)cout<<s[i+1].size()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'm' was not declared in this scope
    8 |         r(i,m){
      |             ^
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:13:13: error: 'n' was not declared in this scope
   13 |         r(i,n)cout<<s[i+1].size()<<endl;
      |             ^
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
Language: C++

#include<iostream>
using namespace std;
int n,m;
int a[55],b[55],c[55];
int main()
{
	cin>>n>>m;
	for(i=1;i<=n;i++)
	{
		cin>>a[i]>>b[i];
		c[a[i]]++;
		c[b[i]]++;
	}	
	for(i=1;i<=n;i++)
	{
		cout<<c[i]<<endl;
	}
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'i' was not declared in this scope
    8 |         for(i=1;i<=n;i++)
      |             ^
a.cc:14:13: error: 'i' was not declared in this scope
   14 |         for(i=1;i<=n;i++)
      |             ^
Language: C++

// glory be to the sky
#include<bits/stdc++.h> 


using namespace std;
	
typedef long long ll; 



int main(){

	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, m;
	int dg[250];
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		++dg[a];
		++dg[b];
	}
	for (int i = 1; i <= n; i++) cout << dg[a] << endl;
	return 0;	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:49: error: 'a' was not declared in this scope
   25 |         for (int i = 1; i <= n; i++) cout << dg[a] << endl;
      |                                                 ^
Language: C++

// glory be to the sky
#include<bits/stdc++.h> 


using namespace std;
	
typedef long long ll; 



int main(){

	ios::sync_with_stdio(false);
	cin.tie(0);

	int n, m;
	int dg[250];
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		cin >> a >> b;
		++dg[a];
		++dg[b];
	}
	for (int i = 1; i <= n; i++) cout << dg[a] << endl;
	return 0;	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: 'a' was not declared in this scope
   20 |                 cin >> a >> b;
      |                        ^
a.cc:20:29: error: 'b' was not declared in this scope
   20 |                 cin >> a >> b;
      |                             ^
a.cc:24:49: error: 'a' was not declared in this scope
   24 |         for (int i = 1; i <= n; i++) cout << dg[a] << endl;
      |                                                 ^
Language: C++

#include<bits/stdc++.h>
int main(void){
  int n,m,i,a;
  int x[51];
  cin>>n>>m;
  for(i=1;i<=n;i++){
    x[i]=0;
  }
  for(i=0;i<m*2;i++){
    cin>>a;
    x[a]+=1;
  }
  for(i=1;i<=n;i++){
    cout<<x[i]
  }
  return 0;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n>>m;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |     cout<<x[i]
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

N,M = map(int,input().split())
a = []
for i in range(M):
    x,y = input().split()
    a.append(x),a.append(y)
    
for i in range(1,N+1):print(a.count(str(i)))


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,M = map(int,input().split())
      | ^
Language: C++

#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <numeric>
using namespace std;
const double PI = acos(-1.0);
const string ALP = "abcdefghijklmnopqrstuvwxyz";
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
int main(){
  int n,m,a;
  cin >> n >> m;
  vector<int> c(n);
  REP(i,m){
    REP(i,2){
      cin >> a;
      c[a]++
    }
  }
  REP(i,n)cout << c[i] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: expected ';' before '}' token
   20 |       c[a]++
      |             ^
      |             ;
   21 |     }
      |     ~
Language: C++

using namespace std;

//--------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define LL long long
#define INF INT_MAX/3

//--------------------------------------------
const double EPS = 1e-14;
const double PI  = acos(-1.0);

//--------------------------------------------

int main(){
  int n,m;
  int a,b;

  scanf("%d %d",&n,&m);

  int city[60];

  REP (i, m) {
    scanf("%d %d",&a,&b);
    city[a - 1] += 1;
    city[b - 1] += 1;
  }

  REP (i, n) printf("%d\n",city[i]);
}


Compiler output:
a.cc:13:20: error: 'acos' was not declared in this scope
   13 | const double PI  = acos(-1.0);
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:21:3: error: 'scanf' was not declared in this scope
   21 |   scanf("%d %d",&n,&m);
      |   ^~~~~
a.cc:31:14: error: 'printf' was not declared in this scope
   31 |   REP (i, n) printf("%d\n",city[i]);
      |              ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C

#include <stdio.h>
int main(){
     int a,b;
     scanf("%d %d",&a,&b);
     int c[a]={0};
     for(int i=0;i<b;i++){
        int x,y;
        scanf("%d%d",&x,&y);
        c[x-1]++;
        c[y-1]++;
     }
     for(int i=0;i<a;i++){
        printf("%d\n",c[i]);
     }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:15: error: variable-sized object may not be initialized except with an empty initializer
    5 |      int c[a]={0};
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
a=a%b;
c=c%b;
for(int i=1;i<=b;i++){
if((a*i)%b==c){
cout<<"YES<<endl;
return 0;
}
}
cout<<"NO<<endl;
return 0;
}

Compiler output:
a.cc:10:7: warning: missing terminating " character
   10 | cout<<"YES<<endl;
      |       ^
a.cc:10:7: error: missing terminating " character
   10 | cout<<"YES<<endl;
      |       ^~~~~~~~~~~
a.cc:14:7: warning: missing terminating " character
   14 | cout<<"NO<<endl;
      |       ^
a.cc:14:7: error: missing terminating " character
   14 | cout<<"NO<<endl;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:11:1: error: expected primary-expression before 'return'
   11 | return 0;
      | ^~~~~~
a.cc:15:1: error: expected primary-expression before 'return'
   15 | return 0;
      | ^~~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#include <cmath>
#define WMAX 10000
#define HMAX 10000
#define NMAX 52
#define MMAX 52

//コメントアウトするとdebug()を実行しない
#define DEBUG

using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

typedef long long ll;
typedef pair<int ,int > P;

struct edge{
  int to,cost;
};

int A[MMAX],B[MMAX],C,N,W,H,ans[NMAX] = {},dp[HMAX][WMAX];
string S;
static const int dx[8] = {0,1,1,1,0,-1,-1,-1},
					dy[8] = {1,1,0,-1,-1,-1,0,1};

void solve(){
	for (int i = 0; i < M; ++i)
	{
		ans[A[i]]++;
		ans[B[i]]++;
	}
}

void debug(){

}

void answer(){
	for (int i = 0; i < N; ++i)
	{
		cout << ans[i] << "\n";
	}
}

int main(){
	cin >> N >> M;
	for (int i = 0; i < M; ++i)
	{
		cin >> A[i] >> B[i];
	}
	solve();
	#ifdef DEBUG
	debug();
	#endif
	answer();

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:41:29: error: 'M' was not declared in this scope
   41 |         for (int i = 0; i < M; ++i)
      |                             ^
a.cc: In function 'int main()':
a.cc:60:21: error: 'M' was not declared in this scope
   60 |         cin >> N >> M;
      |                     ^
Language: C++

#include<stdio.h>
int n,m,p,a[50],b[50],c[50][50];
int main()
{
	scanf("%d%d",&n,&m);
	for(i=0;i<m;i++){
		scanf("%d%d",&a[i],&b[i]);
		c[a[i]][b[i]]=1;
		c[b[i]][a[i]]=1;
	}
	for(i=0;i<n;i++){
		p=0;
		for(j=0;j<51;j++){
			p+=c[i][j];
		}
		printf("%d\n",p);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'i' was not declared in this scope
    6 |         for(i=0;i<m;i++){
      |             ^
a.cc:11:13: error: 'i' was not declared in this scope
   11 |         for(i=0;i<n;i++){
      |             ^
a.cc:13:21: error: 'j' was not declared in this scope
   13 |                 for(j=0;j<51;j++){
      |                     ^
Language: C

#include<stdio.h>

int main(){

	int  nn,mm;
	int ss[51][2];
	int ans;
	int i,j;

	scanf("%d %d",&nn,&mm);

	for(i=0;i<mm;i++){
		scanf("%d %d",&ss[i][0],&ss[i][1]);
	}

	for(j=1;j<=nn;j++){
		ans = 0;
		for(i=0;i<mm;i++){
			if(ss[i][0] == j) ans++;
			if(ss[i][1] == j) ans++;
		}
		printf("%d\n",ans);
	}



Compiler output:
main.c: In function 'main':
main.c:23:9: error: expected declaration or statement at end of input
   23 |         }
      |         ^
Language: C++

n, m = map(int, input().split())
nums = []
for i in range(m) :
    for val in map(int, input().split()):
        nums.append(val-1)
for i in range(n):
    print(nums.count(i))

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, m = map(int, input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m;
	cin >> n >> m;
	int map<int,int> ans;
	for ( int i = 0; i < m; i++)
	{
	int x,y;
	cin >>x >> y;
	ans[x]++;
	ans[y]++;
	}
	for ( int i = 1 ; i <= n; i++)
	cout << ans[i] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: invalid declarator before 'ans'
    7 |         int map<int,int> ans;
      |                          ^~~
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |         ans[x]++;
      |         ^~~
      |         abs
a.cc:16:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |         cout << ans[i] << endl;
      |                 ^~~
      |                 abs
Language: C++

#include<iostream>

using namespace std;
int num[50];

int main(){
    
    int A,B;
    cin >> A >> B >>//A都市,B道路
    
    int n,m;
    int a,b
    
    cin >> n >> m;
    
    while()
    {
        cin >> a >> b;
        num[a]++ ;
        num[b]++:
        
    }
    
    for(int i=1; i <=n; i++)
        cout << num[i] << endl;
    
    return 0;
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected primary-expression before 'int'
   11 |     int n,m;
      |     ^~~
a.cc:14:5: error: expected initializer before 'cin'
   14 |     cin >> n >> m;
      |     ^~~
a.cc:16:11: error: expected primary-expression before ')' token
   16 |     while()
      |           ^
a.cc:18:21: error: 'b' was not declared in this scope
   18 |         cin >> a >> b;
      |                     ^
a.cc:24:22: error: 'n' was not declared in this scope
   24 |     for(int i=1; i <=n; i++)
      |                      ^
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt();
		int m = scan.nextInt();

		int[] m_sum = new int[m];
		
		for(int i = 0 ; i < n ; i++){
			
			int a = scan.nextInt() - 1
			int b = scan.nextInt() - 1
			m_sum[a]++;
			m_sum[b]++;
			
		}
		
		for(int i = 0 ; i < n ; i++){
			
			System.out.println(m_sum[i]);

		}
	}
}

Compiler output:
Main.java:15: error: ';' expected
			int a = scan.nextInt() - 1
			                          ^
Main.java:16: error: ';' expected
			int b = scan.nextInt() - 1
			                          ^
2 errors
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String[] args){

		Scanner scan = new Scanner(System.in);
		
		int n = scan.nextInt();
		int m = scan.nextInt();

		int[] m_sum = new int[m];
		
		for(int i = 0 ; i < n ; i++){
			
			m_sum[scan.nextInt() - 1]++:
			m_sum[scan.nextInt() - 1]++:
			
		}
		
		for(int i = 0 ; i < n ; i++){
			
			System.out.println(m_sum[i]);

		}
	}
}

Compiler output:
Main.java:15: error: ';' expected
			m_sum[scan.nextInt() - 1]++:
			                           ^
Main.java:16: error: ';' expected
			m_sum[scan.nextInt() - 1]++:
			                           ^
2 errors
Language: C++

#include<iostream>
using namespace std;
int main(){
  int ans[100];
  int N,M;
  cin >> N >> M;
  for(int i=0;i<M;i+=){
    int a,b;
    cin >> a >> b;
    ans[a-1]++;
    ans[b-1]++;
  }
  for(int i=0;i<N;i++) cout << ans[i] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expected primary-expression before ')' token
    7 |   for(int i=0;i<M;i+=){
      |                      ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<math.h>
#include<vector>
using namespace std;
 
int c[50];
signed main() {
	int a, b; cin >> a >> b;
	for (int d = 0; d < b; d++) {
		int e, f; cin >> e >> f;
		c[e - 1]++; c[f - 1]++;
	}
	for (int i = 0; i < a; i++) {
		cout << c[i] << endl;
	}
}

Compiler output:
a.cc:7:1: error: extended character   is not valid in an identifier
    7 |  
      | ^
a.cc:7:1: error: '\U000000a0' does not name a type
    7 |  
      | ^
a.cc: In function 'int main()':
a.cc:13:17: error: 'c' was not declared in this scope
   13 |                 c[e - 1]++; c[f - 1]++;
      |                 ^
a.cc:16:25: error: 'c' was not declared in this scope
   16 |                 cout << c[i] << endl;
      |                         ^
Language: Java

//package com.zhangyong.algorithm;

import java.io.*;
import java.util.StringTokenizer;

public class Solution {

    FastScanner in;
    PrintWriter out;

    class FastScanner {

        BufferedReader br;
        StringTokenizer st;

        private FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        private FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

    }


    private void solve() {
        int n, m;
        n = in.nextInt();
        m = in.nextInt();
        int[] arr = new int[n+1];
        int l, r;
        for (int i = 0; i < m; i++) {
            l = in.nextInt();
            r = in.nextInt();
            arr[l] += 1;
            arr[r] += 1;
        }
        for (int i = 1; i <= n; i++) {
            out.println(arr[i]);
        }
    }

    private void run() {
        in = new FastScanner(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }

    public static void main(String[] args) {
        new Solution().run();
    }
}


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

#include <stdio.h>

#define NMAX 50

int main(void) {
	int N, M;
	int A[NMAX], B[NMAX];
	int road[NMAX];
	int i;
	
	scanf("%d %d", N ,M);
	
	for (i = 0; i < M+ i++) {
		scanf("%d %d", A[i], B[i]);
	}
	
	for (i = 0; i < N; i++) {
		road[i] = 0;
	}
	
	for (i = 0; i < M; i++) {
		road[A[i] - 1]++;
		road[B[i] - 1]++;
	}
	
	for (i = 0; i < N; i++) {
		printf("%d\n", road[i]);
	}
	
	return 0;
}



Compiler output:
main.c: In function 'main':
main.c:13:31: error: expected ';' before ')' token
   13 |         for (i = 0; i < M+ i++) {
      |                               ^
      |                               ;
Language: C++

using namespace std;
int main() {
	int N, M, metro, i;
	int count[50] = {};
	cin >> N >> M;
	for (i = 0; i < M * 2; i++) {
		cin >> metro;
		count[metro - 1]++;
	}
	for (i = 0; i < N; i++) {
		cout << count[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> N >> M;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:11:17: error: 'cout' was not declared in this scope
   11 |                 cout << count[i] << endl;
      |                 ^~~~
a.cc:11:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:37: error: 'endl' was not declared in this scope
   11 |                 cout << count[i] << endl;
      |                                     ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
	int m, n;int a[55];
	ios::sync_with_stdio;
	while (cin >> m >> n) {
		memset(a, 0, sizeof(a));
		for (int i = 0; i < n; i++) {
			int aa, bb;
			cin >> aa >> bb;
			if (aa != bb) {
				a[aa]++;
				a[bb]++;
			}
		}
		for (int i = 1; i <= m; i++)
			cout << a[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'memset' was not declared in this scope
    9 |                 memset(a, 0, sizeof(a));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>

using namespace std;

int main(void){
  
  int N,M;
  cin >> N >> M;

  int town[N];

  fill(town,town+N,0);

  for(int i = 0 ;i<M;++i){
    int tmp1,tmp2;
    cin >> tmp1 >> tmp2;
    tmp1--;
    tmp2--;
    town[tmp1]++;
    town[tmp2]++;
  }
  
  for(int i = ; i < N;++i){
    cout << town[i] << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: expected primary-expression before ';' token
   23 |   for(int i = ; i < N;++i){
      |               ^