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

import functools
def divise(n, divisor):
    if n % divisor == 0 and n != divisor:
        return 0
    else:
        return n

if __name__ == '__main__':
    number = input()
#    origin = [int(input()) for _ in range(number)]
    origin = []
    for i in range(number):
        origin.append(input())

    divised = origin

    for i in range(2, max(origin)+1):
        divised = list(map(functools.partial(divise, divisor=i), divised))

    for j in range(number):
        if divised[j] == 0:
            origin.pop(j)

    print(len(origin))

Compiler output:
a.cc:8:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    8 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:10:6: error: invalid preprocessing directive #origin
   10 | #    origin = [int(input()) for _ in range(number)]
      |      ^~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import functools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <stdio.h>
  
int main(){
 int n,primes=0;
 scanf("%d", &n);
 for(int i=0;i<n;i++){
  int num;
  scanf("%d", &num);
  if(num>2&&(!(num%2))){
   continue;
  }
  for(int w=3;w*w<=num;w+=2){
   if(!(num%w)){
    i++;
    goto NEXT_N;
   }
  }
  primes++;
NEXT_N:
  __asm nop;
 }
 printf("%d\n",primes);
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: expected '(' before 'nop'
   20 |   __asm nop;
      |         ^~~
      |         (
a.cc:20:9: error: 'nop' was not declared in this scope
   20 |   __asm nop;
      |         ^~~
Language: C++

#include <stdio.h>
  
int main(){
 int n,primes=0;
 scanf("%d", &n);
 for(int i=0;i<n;i++){
NEXT_N;
  int num;
  scanf("%d", &num);
  for(int w=2;w*w<=num;w++){
   if(!(num%w)){
    i++;
    goto NEXT_N;
   }
  }
  primes++;
 }
 printf("%d\n",primes);
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'NEXT_N' was not declared in this scope
    7 | NEXT_N;
      | ^~~~~~
a.cc:13:10: error: label 'NEXT_N' used but not defined
   13 |     goto NEXT_N;
      |          ^~~~~~
Language: C++

#include<iostream>
#include<math>
#include<vector>
using namespace std;

bool isPrime(int x){
    if(x == 1 || (x > 2 && x % 2 == 0)){
        return false;
    }
    int i = 3, max = (int)squrt(x) + 1;
    //cout << x << ", " << max << endl;
    while(i < max){
        if(x % i == 0){
            return false;
        }
        i += 2;
    }
    return true;
}
int main(){
    int n, i, x, cnt = 0;
    vector<int> v;
    cin >> n;
    for(i = 0; i < n; i++){
        cin >> x;
        v.push_back(x);
    }
    vector<int>::iterator ite = v.begin();
    while(ite != v.end()){
        if(isPrime(*ite)){
            /*if(cnt++ != 0){
                cout << " ";
            }
            cout << *ite;
            */
            cnt++;
        }
        ite++;
    }
    cout << cnt <<endl;
    return 0;
}

Compiler output:
a.cc:2:9: fatal error: math: No such file or directory
    2 | #include<math>
      |         ^~~~~~
compilation terminated.
Language: C++

using System;

namespace teisyutusensei
{
    class Program
    {
        static void Main(string[] args)
        {
//            string result =null;

            int count = 0;
            ////?????????????????????
            string dmmy = Console.ReadLine();

            int n = int.Parse(dmmy);

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

                string dmmy2 = Console.ReadLine();
                int val = int.Parse(dmmy2);

                for (int j = 2; j < val; j++)
                {
                    amari = val % j;

                    if (amari == 0)
                    {
                        count++;
                        break;
                    }

                }
                
            }

            Console.WriteLine(n-count);
            Console.ReadLine();

        }
    }

}



//            string dmmy = Console.ReadLine();
//            string[] input = dmmy.Split(' ');

//            int n = int.Parse(input[0]);
//          int x = int.Parse(input[1]);

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:26: error: 'string' has not been declared
    7 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
    7 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:42:6: error: expected ';' after class definition
   42 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void teisyutusensei::Program::Main(int*)':
a.cc:13:13: error: 'string' was not declared in this scope
   13 |             string dmmy = Console.ReadLine();
      |             ^~~~~~
a.cc:15:21: error: expected primary-expression before 'int'
   15 |             int n = int.Parse(dmmy);
      |                     ^~~
a.cc:21:24: error: expected ';' before 'dmmy2'
   21 |                 string dmmy2 = Console.ReadLine();
      |                        ^~~~~
a.cc:22:27: error: expected primary-expression before 'int'
   22 |                 int val = int.Parse(dmmy2);
      |                           ^~~
a.cc:38:13: error: 'Console' was not declared in this scope
   38 |             Console.WriteLine(n-count);
      |             ^~~~~~~
Language: C++

#!/usr/bin/env python3
from functools import lru_cache
from itertools import count, takewhile


@lru_cache(maxsize=None)
def prime():
    prime = []

    def _isPrime(n):
        for d in takewhile(lambda x: x * x <= n, prime):
            if n % d == 0:
                return False
        return True
    for i in count(2):
        if _isPrime(i):
            prime.append(i)
            yield(i)


@lru_cache(maxsize=None)
def isPrime(n):
    if n < 2:
        return False
    for p in takewhile(lambda x: x * x <= n, prime()):
        if n % p == 0:
            return False
    return True

n = int(input())
c = 0
for _ in range(n):
    i = int(input())
    if isPrime(i):
        c += 1
print(c)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python3
      |  ^
a.cc:6:1: error: stray '@' in program
    6 | @lru_cache(maxsize=None)
      | ^
a.cc:21:1: error: stray '@' in program
   21 | @lru_cache(maxsize=None)
      | ^
a.cc:2:1: error: 'from' does not name a type
    2 | from functools import lru_cache
      | ^~~~
Language: C++

//
//  ALDS_1_1_C.cpp
//
//
//  Created by anthony on 2015/06/17.
//
//

#include <stdio.h>
#include <iostream>
using namespace std;


bool hoge (int a){
    if (a == 2) {
        return true;
    }
    if (a % 2 == 0) {
        return false;
    }
    for (int b = 3; b < sqrt(a); b+=2) {
        if (a % b  == 0) {
            return false;
        }
    }
    return true;
}

int main() {
    
    int m;
    int get;
    int count = 0;
    
    cin >> m;
    
    for (int a = 0; a < m; a++) {
        cin >> get;
        if (hoge(get)) {
            count++;
        }
    }
    
    cout << count << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'bool hoge(int)':
a.cc:21:25: error: 'sqrt' was not declared in this scope
   21 |     for (int b = 3; b < sqrt(a); b+=2) {
      |                         ^~~~
Language: C++

#include <iostream>
 
int main(){
std::cout << 7 << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    4 | std::cout << 7 << endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int gcm(int x, int y){
    int dai = x > y ? x : y;
    int sho = x > y ? y : x;
    int ama;
    
    while(sho){
        ama = dai % sho;
        dai = sho;
        sho = ama;
    }
    
    return dai;
}

int main() {
    int n, cnt = 0;
    cin >> n;
    for(int i = 0; i < N; i++){
        int c;
        cin >> c;
        if(c != 1 || c == 2 || gcm(2, c) == 1){
            ++cnt;
            continue;
        }
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: 'N' was not declared in this scope
   21 |     for(int i = 0; i < N; i++){
      |                        ^
Language: C++

#include <iostream>
using namespace std;

bool isprime(int x){
	if (x == 2)
		return true;

	if (x < 2 || x % 2 == 0)
		return false;

	int	i = 3;
	while (i <= sqrt(x)){
		if (x%i == 0)
			return false;
		i += 2;
	}
	return true;
}

int main(void){
	int N, A, count=0;

	cin >> N;

	for (int i = 0; i < N; i++){
		cin >> A;

		if (isprime(A))
			count++;
	}

	cout << count << "\n";

	return 0;
}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:12:21: error: 'sqrt' was not declared in this scope
   12 |         while (i <= sqrt(x)){
      |                     ^~~~
Language: C++

import java.util.Scanner;


public class Main{

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int cnt = Integer.parseInt(s.nextLine());
		int result = 0;
		for(int i=0 ; i<cnt ; i++) {
			int number = Integer.parseInt(s.nextLine());
			result += solve(number);
		}
		System.out.println(result);
	}

	public static int solve(int number) {
		boolean[] table = new boolean[number+1];
		int min = 2;
		for(int i=2 ; i<number ; i++) {
			if(!table[i])
				min = i;
			else
				break;

			for(int j=2 ; number>=j*min ; j++) {
				table[j*min] = true;
			}
		}
		if(table[number])
			return 0;
		else
			return 1;
	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main{
      | ^~~~~~
Language: C++

#include <stdio.h>
#include <math.h>
int isprime(int);
int main(){
  int a,i,n[10000],count=0;
  scanf("%d",&a);
  for(i=0;i<a;i++){
    scanf("%d",&n[i]);
    if(isprime(n[i])==0)
      count++;
  }
  printf("%d\n",count);
  return 0;
}
int isprime(n)
{
  int j=3;
  if (n==2)
    return 0;
  if  (n<2||n%2==0)
    return 1;
  while (j<=sqrt(n)){
    if (n%j==0)
      return 1;
    j = j + 2;
  }
  return 0;
}

Compiler output:
a.cc:15:14: error: 'int isprime' redeclared as different kind of entity
   15 | int isprime(n)
      |              ^
a.cc:3:5: note: previous declaration 'int isprime(int)'
    3 | int isprime(int);
      |     ^~~~~~~
a.cc:15:13: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 | int isprime(n)
      |             ^
      |             yn
Language: C++

#include <stdio.h>
#include <math.h>
int isprime(int);
int main(){
  int a,j,n[10000],count=0;
  scanf("%d",&a);
  for(j=0;j<a;j++){
    scanf("%d",&n[j]);
    if(isprime(n[j])==0)
      count++;
  }
  printf("%d\n",count);
  return 0;
}
int isprime(n)
{
  int i=3;
  if (n==2)
    return 0;
  if  (n<2||n%2==0)
    return 1;
  while (i<=sqrt(n)){
    if (n%i==0)
      return 1;
    i = i + 2;
  }
  return 0;
}

Compiler output:
a.cc:15:14: error: 'int isprime' redeclared as different kind of entity
   15 | int isprime(n)
      |              ^
a.cc:3:5: note: previous declaration 'int isprime(int)'
    3 | int isprime(int);
      |     ^~~~~~~
a.cc:15:13: error: 'n' was not declared in this scope; did you mean 'yn'?
   15 | int isprime(n)
      |             ^
      |             yn
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include<string>
#include <algorithm>
#include <functional>
using namespace std;
typedef vector <int> ivector;

void save(ivector &a, int n){
	int ceil = sqrt(n);
	
	a.push_back(2);
	for (int i = 3; i < n; i++){
		bool frag = false;
		for (int j = 0; j < a.size(); j++){
			int now = a[j];
			if (i%now == 0){
				frag = true;
				break;
			}
		}
		if (!frag){
			a.push_back(i);
		}
	}

}
bool isPrime(int num,ivector &prime){
	vector<int>::iterator it = find(prime.begin(), prime.end(), num);
	return (it != prime.end());
}
int main(){
	
	ivector prime;
	save(prime, 10000);
	int N;
	cin >> N;
	int count = 0;
	for (int i = 0; i < N; i++){
		int num;
		scanf("%d", &num);
		if (isPrime(num, prime)){
			count++;
		}
	}
	cout << count << endl;

	return 0;
}

Compiler output:
a.cc: In function 'void save(ivector&, int)':
a.cc:14:20: error: 'sqrt' was not declared in this scope
   14 |         int ceil = sqrt(n);
      |                    ^~~~
Language: C++

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


//?´???°?????°??????????????°??????
//??¨?????????????????????????????¨??????
int IsPrimeNumber(int num){

	int count = 0;
	//?´???°????????????num?????§????¢??????§??????
	//??????30?????§????´???°?????°????????????1*30???2*15???3*10???5*6??¨??°??????????????¨??????
	//5????¶???????????????§????????\???????´???°?????¢?????§???????????¨??????????????????????????§???
	//???30?????§????´???°??????????????????????????°????????\???????´???°?????§?????????
	//???30?????§????´???°???4?????????????????\???????´???°???4??????????????¨????????????

	if (num == 2 || num == 3){ return 1; }
	else if (num < 2 || num % 2 == 0 || num % 3 == 0){ return 0; }
	else{
	
		for (int n = 5; n < sqrt(num); n++){
			if (num%n == 0)return 0;
		}
		return 1;
	}

}


int main(){

	int n,num,count=0;
	cin >> n;

	for (int j = 0; j < n; j++){
		cin >> num;
		if (IsPrimeNumber(num) == 1)count++;
		
	}cout << count << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int IsPrimeNumber(int)':
a.cc:21:37: error: 'sqrt' was not declared in this scope
   21 |                 for (int n = 5; n < sqrt(num); n++){
      |                                     ^~~~
Language: C++

import sys
import math

x_list = []

for line in sys.stdin.readlines()
  x_list.append(int(line.strip()))

count = 0

num_list.remove(x_list[0])

for i in x_list:
  flag = 0
  for j in range(2, math.sqrt(i)+1):
    if i % j == 0:
      flag = 1
      break
    if flag == 0:
      count ++

print count
    

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

import math

n = int(raw_input())
num = list()
count = 0
max = 0

for i in range(n):
    num.append(int(raw_input()))

for i in range(n):
    root_num = math.sqrt(num[i])
    for j in range(2, int(root_num) + 1):
        if num[i] % j == 0:
            count = count + 1
            break

print n - count

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <stdio.h>
#include <stdbool.h>

int main() {
  int n;
  int in;
  int num_prime = 0;
  bool isPrime = true;

  scanf("%d", &n);
  if(n < 1 || n > 10000) {
    printf("Error: n is out of range");
    return -1;
  }

  for(int i = 0; i < n; i++) {
    scanf("%d", &in);
    if(in < 2 || in > 10e8) {
      printf("Error: the input is out of range");
      return -1;
    }

    // check if is prime
    if(in == 2 || in == 3) {
      isPrime = true;
    }
    else if(in % 2 == 0) {isPrime = false;}
    else if(in % 2 != 0) {
      half_in = in / 2;
      for(int i = 3; i < half_in - 1; i += 2) {
        if(half_in % i == 0) {
          isPrime = false;
          break;
        }
      }
    }

    if(isPrime == false) {
      isPrime = true;
      continue;
    }
    else if(isPrime == true) {
      num_prime += 1;
      /* printf("is prime\n"); */
    }
  }

  printf("%d\n", num_prime);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:7: error: 'half_in' was not declared in this scope
   29 |       half_in = in / 2;
      |       ^~~~~~~
Language: C++

#include <cmath>
#include <iostream>

using namespace std;

typedef unsigned int uint32;

namespace {
bool IsPrime(uint32 x) {
  if (x == 2) {
    return true;
  }
  if (x % 2 == 0) {
    return false;
  }

  const uint32_t m = static_cast<uint32>(sqrt(x));
  for (size_t i = 3; i <= m; ++i) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
} // namespace

int main() {
  uint32 n;
  cin >> n;

  uint32 c = 0;
  uint32 x;
  for (uint32 i = 0; i < n; ++i) {
    cin >> x;
    if (IsPrime(x)) {
      ++c;
    }
  }
  cout << c << endl;
  return 0;
}

Compiler output:
a.cc: In function 'bool {anonymous}::IsPrime(uint32)':
a.cc:17:9: error: 'uint32_t' does not name a type
   17 |   const uint32_t m = static_cast<uint32>(sqrt(x));
      |         ^~~~~~~~
a.cc:3:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <iostream>
  +++ |+#include <cstdint>
    3 | 
a.cc:18:27: error: 'm' was not declared in this scope
   18 |   for (size_t i = 3; i <= m; ++i) {
      |                           ^
Language: C++

#include <iostream>

using namespace std;

int prime_check(int n, int k)
{
    if(k * k > n) { return true; }

    if(n % k == 0) { return false; }

    return prime_check(n, k + 1);
}

int main()
{
    const int DATASETS = 10000;

    int n, data[DATASETS];

    cin >> n;

    for(int i = 0; i < n; i++) { cin >> data[i]; }

    for(int i = 0; i < n; i++) { cout << prime_check(data[i], 2);

    return 0;
}

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

#!/usr/bin/ruby

N = $stdin.gets.chomp;

num_of_prime=0;
primes  = [2];
list  = [];
list.push($stdin.gets.chomp.to_i);

2.step(list[0], 1) do |i|
  not_prime = 0;
  primes.each do |prime|
    if i % prime == 0 then
      not_prime+=1;
    end
  end
  if not_prime == 0 then
    primes.push(i);
  end
end

if primes[primes.length-1] == list[0] then
  num_of_prime+=1;
end

while num = $stdin.gets do
  i = num.chomp.to_i;
  not_prime = 0;
  primes.each do |prime|
    if i != prime && i % prime == 0 then
      not_prime+=1;
    end
  end
  if not_prime == 0 then
    primes.push(i);
    num_of_prime+=1;
  end
end

print(num_of_prime.to_s + "\n");

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/ruby
      |  ^
a.cc:3:1: error: 'N' does not name a type
    3 | N = $stdin.gets.chomp;
      | ^
a.cc:5:1: error: 'num_of_prime' does not name a type
    5 | num_of_prime=0;
      | ^~~~~~~~~~~~
a.cc:6:1: error: 'primes' does not name a type
    6 | primes  = [2];
      | ^~~~~~
a.cc:7:1: error: 'list' does not name a type
    7 | list  = [];
      | ^~~~
a.cc:8:1: error: 'list' does not name a type
    8 | list.push($stdin.gets.chomp.to_i);
      | ^~~~
a.cc:10:1: error: expected unqualified-id before numeric constant
   10 | 2.step(list[0], 1) do |i|
      | ^~~~~~
a.cc:12:3: error: 'primes' does not name a type
   12 |   primes.each do |prime|
      |   ^~~~~~
a.cc:15:5: error: 'end' does not name a type
   15 |     end
      |     ^~~
a.cc:19:3: error: 'end' does not name a type
   19 |   end
      |   ^~~
a.cc:24:1: error: 'end' does not name a type
   24 | end
      | ^~~
a.cc:28:3: error: 'not_prime' does not name a type
   28 |   not_prime = 0;
      |   ^~~~~~~~~
a.cc:29:3: error: 'primes' does not name a type
   29 |   primes.each do |prime|
      |   ^~~~~~
a.cc:32:5: error: 'end' does not name a type
   32 |     end
      |     ^~~
a.cc:36:5: error: 'num_of_prime' does not name a type
   36 |     num_of_prime+=1;
      |     ^~~~~~~~~~~~
a.cc:37:3: error: 'end' does not name a type
   37 |   end
      |   ^~~
Language: C++

bool IsPrimeNumber(int num)
{
    // (2 <= num <= 10の8乗) なので、1の判定は略
    if ((num & 1) == 0) {
        return (num == 2);
    } else {
        int d = 3;
        while (d * d <= num) {
            if ((num % d) == 0) {
                return false;
            }
            d += 2;
        }
    }
    return true;
}
 
int main()
{
    int n;
    std::cin >> n;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        int val;
        std::cin >> val;
        if (IsPrimeNumber(val)) {
            ++count;
        }
    }
    std::cout << count << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:10: error: 'cin' is not a member of 'std'
   21 |     std::cin >> n;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | bool IsPrimeNumber(int num)
a.cc:25:14: error: 'cin' is not a member of 'std'
   25 |         std::cin >> val;
      |              ^~~
a.cc:25:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:10: error: 'cout' is not a member of 'std'
   30 |     std::cout << count << std::endl;
      |          ^~~~
a.cc:30:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:32: error: 'endl' is not a member of 'std'
   30 |     std::cout << count << std::endl;
      |                                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | bool IsPrimeNumber(int num)
Language: C++

#include "stdio.h"
 
 
void main()
{
    int N = 0;
    //printf("INPUT: ");
    scanf_s("%d", &N);
    int prime_n = 0;
    for (int i = 0; i < N; i++){
        int n = 0;
        scanf_s("%d", &n);
        int isPrime = 1;
//      printf("%d  ", n);
        for (int j = 2; j < n/j; j++){
//          printf("%d", j);
            if (n%j == 0){
                isPrime = 0;
                break;
            }
        }
        if (isPrime){ prime_n++; }
    }
    //printf("result");
    printf("%d", prime_n);
 
    //getchar();
    //getchar();
 
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |     scanf_s("%d", &N);
      |     ^~~~~~~
      |     scanf
Language: C++

#include "stdafx.h"


int main()
{
	int N = 0;
	//printf("INPUT: ");
	scanf_s("%d", &N);
	int prime_n = 0;
	for (int i = 0; i < N; i++){
		long n = 0;
		scanf_s("%d", &n);
		int isPrime = 1;
//		printf("%d  ", n);
		for (long j = 2; j < n/j; j++){
//			printf("%d", j);
			if (n%j == 0){
				isPrime = 0;
				break;
			}
		}
		if (isPrime){ prime_n++; }
	}
	//printf("result");
	printf("%d", prime_n);

	//getchar();
	//getchar();
	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++

#include <math.h>
#include <iostream>
using namespace std;

bool is_prime(int num){
    if(num < 2 || x%2 == 0)
        return false;
    if (num==2)
        return true;
    for(int i =3;i<=sqrt(num);i+=2){
        if (num%i ==0)
            return false;
    }
    return true;
}



int main(){
    int N;
    int count = 0;
    cin>>N;
    int num;
    for(int i=0;i<N;i++){
        cin>>num;
        if(is_prime(num))
            count++;
    }
    cout<<count<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'bool is_prime(int)':
a.cc:6:19: error: 'x' was not declared in this scope
    6 |     if(num < 2 || x%2 == 0)
      |                   ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
 
int main() {
    int n,m,i,count;
    cin >> n;
    count = 0;

    for (int j = 0; j < n ; ++j){
        cin >> m;
        if (m == 2) ++count;
        else if (m < 2 || m%2 ==0){
            continue;
        }
        else{
            i = 3;
            while(i <= sqrt(m)){
                if(m%i == 0) break;
                i = i+2;
            }
            if(i > sqrt(m)) {
                ++count;
            }
        }
    } 
    cout << count << endl;
    return 0;
}#include <iostream>
#include <cmath>
using namespace std;
 
int main() {
    int n,m,i,count;
    cin >> n;
    count = 0;

    for (int j = 0; j < n ; ++j){
        cin >> m;
        if (m == 2) ++count;
        else if (m < 2 || m%2 ==0){
            continue;
        }
        else{
            i = 3;
            while(i <= sqrt(m)){
                if(m%i == 0) break;
                i = i+2;
            }
            if(i > sqrt(m)) {
                ++count;
            }
        }
    } 
    cout << count << endl;
    return 0;
}

Compiler output:
a.cc:29:2: error: stray '#' in program
   29 | }#include <iostream>
      |  ^
a.cc:29:3: error: 'include' does not name a type
   29 | }#include <iostream>
      |   ^~~~~~~
a.cc:33:5: error: redefinition of 'int main()'
   33 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	//ifstream fin("ALDS1_1_C_in4.txt");

	int n;
	cin >> n;
	cin.ignore();

	vector<int> v;

	for (int i = 0; i < n; i++)
	{
		int t;
		cin >> t;
		v.push_back(t);
	}

	vector<bool> vp;

	int m = sqrt(*max_element(v.begin(), v.end()));
	vp.resize(m);
	fill(vp.begin(), vp.end(), true);
	vp[0] = false;
	vp[1] = false;


	for (int i = 2; i * i < m; i++)
	{
		if (vp[i] == true)
		{
			for (int j = i * i; j < m; j += i)
			{
				vp[j] = false;
			}
		}
	}

	vector<int> vpp;

	for (int i = 2; i < vp.size(); i++)
	{
		if (vp[i] == true)
		{
			vpp.push_back(i);
		}
	}

	int count = 0;
	for (int i = 0; i < v.size(); i++)
	{
		for (int j = 0; j < vpp.size(); j++)
		{
			if (v[i] % vpp[j] == 0)
			{
				count++;
			}
		}
	}

	cout << count << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'sqrt' was not declared in this scope
   29 |         int m = sqrt(*max_element(v.begin(), v.end()));
      |                 ^~~~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
	//ifstream fin("ALDS1_1_C_in1.txt");

	int n;
	cin >> n;
	cin.ignore();

	vector<int> v;

	for (int i = 0; i < n; i++)
	{
		int t;
		cin >> t;
		v.push_back(t);
	}

	int m = *max_element(v.begin(), v.end()) + 1;

	bool* bp;
	bp = (bool *)malloc(sizeof(bool) * m);

	memset(bp, true, sizeof(bool) * m);
	bp[0] = false;
	bp[1] = false;


	for (int i = 2; i * i < m; i++)
	{
		if (*(bp + sizeof(bool) * i) == true)
		{
			for (int j = i * i; j < m; j += i)
			{
				*(bp + sizeof(bool) * j) = false;
			}
		}
	}

	int count = 0;
	for (int i = 0; i < v.size(); i++)
	{
		if (*(bp + v[i]) == true)
			count++;
	}
	cout << count << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'memset' was not declared in this scope
   33 |         memset(bp, true, sizeof(bool) * m);
      |         ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <cmath>
  +++ |+#include <cstring>
    8 |
Language: C++

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

bool isprime(int a);

int main() {
	int i, n, a, count = 0;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> a;
		if (isprime(a) == true)count++;
	}
	cout << count << endl;
	return 0;
}

bool isprime(int a) {
	int i;
	bool flag;
	for (i = 2; i < sqrt(a); i++) {
		if (a % i == 0)break;
	}
	if (i > sqrt(a))return true;
	else return false;
}

Compiler output:
a.cc: In function 'bool isprime(int)':
a.cc:21:25: error: 'sqrt' was not declared in this scope
   21 |         for (i = 2; i < sqrt(a); i++) {
      |                         ^~~~
a.cc:24:17: error: 'sqrt' was not declared in this scope
   24 |         if (i > sqrt(a))return true;
      |                 ^~~~
a.cc:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      | ^
Language: C++

#include<stdio.h>
#include<math.h>

int main(){
	int i,n,x;
	int count=0,ncount=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&x);
		if(PN(x)== 0){
			count++;
		}else{
			ncount++;
		}
	}
	printf("%d\n",count);
}

int PN(int x){
	int i;
	if(x == 2){
		return 0;
	}else if(x<2 || x%2==0){
		return -1;
	}
	i = 3;
	while(i <= sqrt(x)){
		if(x%i==0){
			return -1;
		}
		i = i+2;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'PN' was not declared in this scope
   10 |                 if(PN(x)== 0){
      |                    ^~
Language: C++

#include <stdio.h>

int sosu(int *)

int main(){
  
  int i,n,a[10000],c;
  
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&a[i]);
  
  for(i=0;i<n;i++) {
    c = sosu(a[i]);
    if(c == 1) b++;
  }
  
  printf("%d\n",b);
  
  return 0;
}

int sosu(int *n) {
  int i;

  if(n<2)
    return 0;
  else if(n == 2)
    return 1;

  if(n%2 == 0)
    return 0;

  for(i=3;i<=n/i;i+=2)
    if(n%i == 0)
      return 0;
  return 1;

}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int main(){
      | ^~~
a.cc: In function 'int sosu(int*)':
a.cc:25:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   25 |   if(n<2)
      |      ~^~
a.cc:27:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   27 |   else if(n == 2)
      |           ~~^~~~
a.cc:30:7: error: invalid operands of types 'int*' and 'int' to binary 'operator%'
   30 |   if(n%2 == 0)
      |      ~^~
      |      | |
      |      | int
      |      int*
a.cc:33:15: error: invalid operands of types 'int*' and 'int' to binary 'operator/'
   33 |   for(i=3;i<=n/i;i+=2)
      |              ~^~
      |              | |
      |              | int
      |              int*
a.cc:34:9: error: invalid operands of types 'int*' and 'int' to binary 'operator%'
   34 |     if(n%i == 0)
      |        ~^~
      |        | |
      |        | int
      |        int*
Language: C++

#include <stdio.h>
#include <math.h>
#define N 10000
int main(){
  int i, n, num;
  double A[N], v, r, j, l;
  scanf("%d",&n);
  for(i=0 ; i<n ; i++){
    scanf("%lf",&A[i]);
  }
 
  for(i = 0 ; i < n ; i++)
    {
      v=A[i];
      if(v==2.0){
	num++;
	continue;
      }else if(v<2 && (v%2.0)==0.0){
	continue;
      }
      j=3;
      r=sqrt(v);
      while(j <= r)
	{
	  if((r%j) == 0.0){
	    break;
	  }	  j = j + 2;
	}
      if(j == r+2){
	num++;
      }
    }

  printf("%d\n",num);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   18 |       }else if(v<2 && (v%2.0)==0.0){
      |                        ~^~~~
      |                        | |
      |                        | double
      |                        double
a.cc:25:16: error: invalid operands of types 'double' and 'double' to binary 'operator%'
   25 |           if((r%j) == 0.0){
      |               ~^~
      |               | |
      |               | double
      |               double
Language: C++

import scala.io.StdIn
 
object Main {
  def main(args: Array[String]){
    val inputs = (0 to (StdIn.readInt() - 1)).map(_ => StdIn.readInt)
    println(inputs.filter{i =>
      (2 to Math.sqrt(i).toInt).forall(i % _ != 0)}.length)
  }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import scala.io.StdIn
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <stdio.h>
int q, n, c;
int modpow(int a, int b, int m) {
	int ret = 1;
	for(int i = 30; i >= 0; i--) {
		ret = 1LL * ret * ret % m;
		if(b & (1 << i)) ret = 1LL * ret * a % m;
	}
	return ret;
}
bool issprp(int x, int a) {
	int d = x - 1, s = 0;
	while(d % 2 == 0) d /= 2, s++;
	int p = modpow(a, d, x);
	if(p == 1) return true;
	for(int i = 0; i < s; i++) {
		if(p == x - 1) return true;
		p = 1LL * p * p % x;
	}
	return false;
}
bool slowprime(int x) {
	for(int i = 2; i * i <= x; i++) {
		if(x % i == 0) return false;
	}
	return true;
}
bool isprime(int x) {
	if(x < 30000) return slowprime(x);
	return issprp(x, 2) && issprp(x, 7) && issprp(x, 61);
}
int main() {
	scanf("%d", &q);
	for(int i = 0; i < q; i++) {
		scanf("%d", &n);
		if(n > 1 && isprime(n)) c++;)
	}
	printf("%d\n", c);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:45: error: expected primary-expression before ')' token
   36 |                 if(n > 1 && isprime(n)) c++;)
      |                                             ^
Language: C++

#include<iostream>
#include<cmath>

using namespace std;

int main() {

        int n, cnt = 0;
        cin >> n;
        long N;
        while (cin >> N) {
                long sqr = sqrt(N);
                if (sqr < 2) {
                        cnt++;
                        continue;
                }
                for (long j = 2; j <= sqr; j++) {
                        if ((N % j) == 0) {
                                cnt++;
                                break;
                        }
                }
        }

        cout << cnt << endl;

        return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: expected '}' at end of input
   27 |         return 0;
      |                  ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

using System;

class PrimeNum
{
    //private static int k;
    public static int Check(int num)
    {
        int k=0;
        if (num == 2)
            return 1;
        if (num % 2 == 0 && num !=2)
            return 0;

        for (int j = 2; j <= (int)Math.Sqrt(num); j++)
        {
            if (num % j == 0)
            {
                k = 1;
                break;
            }
        }
        if (k==0)
            return 1;
        return 0;
    }
}
class Program
{
    static void Main()
    {
        int count = 0;
        int n = int.Parse(Console.ReadLine());
        for(int i=0;i<n;i++)
        {
            int num = int.Parse(Console.ReadLine());
            count += PrimeNum.Check(num);
        }
        Console.WriteLine(count);
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:6:11: error: expected ':' before 'static'
    6 |     public static int Check(int num)
      |           ^~~~~~~
      |           :
a.cc:26:2: error: expected ';' after class definition
   26 | }
      |  ^
      |  ;
a.cc: In static member function 'static int PrimeNum::Check(int)':
a.cc:14:35: error: 'Math' was not declared in this scope
   14 |         for (int j = 2; j <= (int)Math.Sqrt(num); j++)
      |                                   ^~~~
a.cc: At global scope:
a.cc:40:2: error: expected ';' after class definition
   40 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:32:17: error: expected primary-expression before 'int'
   32 |         int n = int.Parse(Console.ReadLine());
      |                 ^~~
a.cc:35:23: error: expected primary-expression before 'int'
   35 |             int num = int.Parse(Console.ReadLine());
      |                       ^~~
a.cc:36:30: error: expected primary-expression before '.' token
   36 |             count += PrimeNum.Check(num);
      |                              ^
a.cc:38:9: error: 'Console' was not declared in this scope
   38 |         Console.WriteLine(count);
      |         ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int n,x;
	int count=0;
	cin >> n;
	int *a =new int [n];
	for(int i=0;i < n ;i++){
		cin >> x;
		a[i]=x;
		if(a[i]%2==1) count ++;




	}
	cout << count???<<endl;

	return 0;
}

Compiler output:
a.cc:18:23: warning: trigraph ??< ignored, use -trigraphs to enable [-Wtrigraphs]
   18 |         cout << count???<<endl;
a.cc: In function 'int main()':
a.cc:18:23: error: expected primary-expression before '?' token
   18 |         cout << count???<<endl;
      |                       ^
a.cc:18:24: error: expected primary-expression before '?' token
   18 |         cout << count???<<endl;
      |                        ^
a.cc:18:25: error: expected primary-expression before '<<' token
   18 |         cout << count???<<endl;
      |                         ^~
a.cc:18:31: error: expected ':' before ';' token
   18 |         cout << count???<<endl;
      |                               ^
      |                               :
a.cc:18:31: error: expected primary-expression before ';' token
a.cc:18:31: error: expected ':' before ';' token
   18 |         cout << count???<<endl;
      |                               ^
      |                               :
a.cc:18:31: error: expected primary-expression before ';' token
a.cc:18:31: error: expected ':' before ';' token
   18 |         cout << count???<<endl;
      |                               ^
      |                               :
a.cc:18:31: error: expected primary-expression before ';' token
Language: C++

#include <stdio.h>
#include <vector>
#include <algorithm>

int gcd(int x, int y) {

	if (y == 0) return x;
	if (x >= y) return gcd(y, x % y);
	else return gcd(x, y % x);
}

bool isprime(int a) {
	if (a == 1) return false;

	for (int i = 2; i < a; i++) {
		if (a % i == 0) return false;
	}

	return true;
}

int main() {
	int n;
	std::vector<int> d;

	scanf_s("%d", &n);
	for (int i = 0; i < n; i++) {
		int b;
		scanf_s("%d", &b);
		d.push_back(b);
	}

	printf("%d", 
		std::count_if(d.begin(), d.end(),isprime));

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   26 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C++

using namespace std;

void InsertionSort(int a[], int n) {
	for (int i = 0; i < n; i++) {
		int v = a[i];
		int j = i - 1;
		while (j >= 0 && a[j] > v) {
			a[j + 1] = a[j];
			j--;
		}
		a[j + 1] = v;
		for (int i = 0; i < n-1; i++) {
			cout << a[i] << ' ';
		}
		cout << a[n - 1] << endl;
	}
}

int GCD(int x, int y) {
	if (x%y == 0) return y;
	else {
		return GCD(y, x%y);
	}
}

bool PrimeNumber(int p) {
	if (p == 2) return true;
	if (p < 2 || p % 2 == 0) return false;

	int i = 3;
	while (i <= sqrt((double)p)) {
		if (p%i == 0) {
			return false;
		}
		i = i + 2;
	}
	return true;
}

int main() {
	int n;
	int a[10000];
	int count = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	for (int i = 0; i < n; i++) {
		if (PrimeNumber(a[i])) count++;
	}
	cout << count << endl;
	
}

Compiler output:
a.cc: In function 'void InsertionSort(int*, int)':
a.cc:13:25: error: 'cout' was not declared in this scope
   13 |                         cout << a[i] << ' ';
      |                         ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:15:17: error: 'cout' was not declared in this scope
   15 |                 cout << a[n - 1] << endl;
      |                 ^~~~
a.cc:15:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:37: error: 'endl' was not declared in this scope
   15 |                 cout << a[n - 1] << 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;
a.cc: In function 'bool PrimeNumber(int)':
a.cc:31:21: error: 'sqrt' was not declared in this scope
   31 |         while (i <= sqrt((double)p)) {
      |                     ^~~~
a.cc: In function 'int main()':
a.cc:44:9: error: 'cin' was not declared in this scope
   44 |         cin >> n;
      |         ^~~
a.cc:44:9: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:52:9: error: 'cout' was not declared in this scope
   52 |         cout << count << endl;
      |         ^~~~
a.cc:52:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:52:26: error: 'endl' was not declared in this scope
   52 |         cout << count << endl;
      |                          ^~~~
a.cc:52:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>
using namespace std;

bool check_prime(int n){
	int i = 2;
	bool flg==true;
	while(i < n){
		if (n%i==0) {
			flg==false;
			break;
		}
		else{
			i++;	
		}
	}
	return flg;
}


int main() {
	int N;
	const int MAX_N = 10000;
	
	cin >> N;
	
	int arr[MAX_N];
	
	for(int i = 0; i<N ;i++){
		cin >> arr[i];	
	}
	
	int count = 0;
	for (int i = 0; i<N ; i++){
		if (check_prime(arr[i])==true) {
			count++;
		}
	}
	cout << count ;
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'bool check_prime(int)':
a.cc:6:17: error: expected initializer before '==' token
    6 |         bool flg==true;
      |                 ^~
a.cc:9:25: error: 'flg' was not declared in this scope
    9 |                         flg==false;
      |                         ^~~
a.cc:16:16: error: 'flg' was not declared in this scope
   16 |         return flg;
      |                ^~~
Language: C++

#include <iostream>
using namespace std;

bool check_prime(int n){
	int i = 2;
	bool flg==true;
	while(i < n){
		if (n%i==0) {
			flg = false;
			break;
		}
		else{
			i++;	
		}
	}
	return flg;
}


int main() {
	int N;
	const int MAX_N = 10000;
	
	cin >> N;
	
	int arr[MAX_N];
	
	for(int i = 0; i<N ;i++){
		cin >> arr[i];	
	}
	
	int count = 0;
	for (int i = 0; i<N ; i++){
		if (check_prime(arr[i])==true) {
			count++;
		}
	}
	cout << count << endl;
}

Compiler output:
a.cc: In function 'bool check_prime(int)':
a.cc:6:17: error: expected initializer before '==' token
    6 |         bool flg==true;
      |                 ^~
a.cc:9:25: error: 'flg' was not declared in this scope
    9 |                         flg = false;
      |                         ^~~
a.cc:16:16: error: 'flg' was not declared in this scope
   16 |         return flg;
      |                ^~~
Language: C++

#include<stdio.h>
#include<iostream>
 
using namespace std;
 
int main(){
 
int n;
int p=0;
cin>>n;

for(int i=0;i<n;i++){
int m;
cin>>m;
if(m==2) {
p++;
continue;
}
else if( m<2 || m%2==0)continue;

int t=0;
for(int j=3;j<=sqrt(m);j++){
if(m%j=0){
t++;
break;
}

if(t==0)p++;
}
 
cout<<p<<endl;
 
return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:16: error: 'sqrt' was not declared in this scope
   22 | for(int j=3;j<=sqrt(m);j++){
      |                ^~~~
a.cc:23:5: error: lvalue required as left operand of assignment
   23 | if(m%j=0){
      |    ~^~
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<stdio.h>
#include<iostream>
 
using namespace std;
 
int main(){
 
int n;
int p=0;
cin>>n;

for(int i=0;i<n;i++){
int m;
cin>>m;
if(m==2) {
p++;
continue;
}
else if( m<2 || m%2==0)continue;

int t=0;
bouble sqr=sqrt(m);
for(int j=3;j<=sqr;j++){
if(m%j=0){
t++;
break;
}

if(t==0)p++;
}
 
cout<<p<<endl;
 
return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:1: error: 'bouble' was not declared in this scope; did you mean 'double'?
   22 | bouble sqr=sqrt(m);
      | ^~~~~~
      | double
a.cc:23:16: error: 'sqr' was not declared in this scope
   23 | for(int j=3;j<=sqr;j++){
      |                ^~~
a.cc:24:5: error: lvalue required as left operand of assignment
   24 | if(m%j=0){
      |    ~^~
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<stdio.h>
#include<iostream>
 
using namespace std;
 
int main(){
 
int n;
int p=0;
cin>>n;

for(int i=0;i<n;i++){
int m;
cin>>m;
if(m==2) {
p++;
continue;
}
else if( m<2 || m%2==0)continue;

int t=0;
double sqr=sqrt(m);
for(int j=3;j<=sqr;j++){
if(m%j=0){
t++;
break;
}

if(t==0)p++;
}
 
cout<<p<<endl;
 
return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:12: error: 'sqrt' was not declared in this scope; did you mean 'sqr'?
   22 | double sqr=sqrt(m);
      |            ^~~~
      |            sqr
a.cc:24:5: error: lvalue required as left operand of assignment
   24 | if(m%j=0){
      |    ~^~
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<stdio.h>
#include<iostream>
 
using namespace std;
 
int main(){
 
int n;
int p=0;
cin>>n;

for(int i=0;i<n;i++){
double m;
cin>>m;
if(m==2) {
p++;
continue;
}
else if( m<2 || m%2==0)continue;

int t=0;
double sqr=sqrt(m);
for(int j=3;j<=sqr;j++){
if(m%j=0){
t++;
break;
}

if(t==0)p++;
}
 
cout<<p<<endl;
 
return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   19 | else if( m<2 || m%2==0)continue;
      |                 ~^~
      |                 | |
      |                 | int
      |                 double
a.cc:22:12: error: 'sqrt' was not declared in this scope; did you mean 'sqr'?
   22 | double sqr=sqrt(m);
      |            ^~~~
      |            sqr
a.cc:24:5: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   24 | if(m%j=0){
      |    ~^~
      |    | |
      |    | int
      |    double
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<stdio.h>
#include<iostream>
 
using namespace std;
 
int main(){
 
int n;
int p=0;
cin>>n;

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

cin>>m;

double mt=m;
if(m==2) {
p++;
continue;
}
else if( m<2 || m%2==0)continue;

int t=0;
double sqr=sqrt(mt);
for(int j=3;j<=sqr;j++){
if(m%j=0){
t++;
break;
}

if(t==0)p++;
}
 
cout<<p<<endl;
 
return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: 'sqrt' was not declared in this scope; did you mean 'sqr'?
   25 | double sqr=sqrt(mt);
      |            ^~~~
      |            sqr
a.cc:27:5: error: lvalue required as left operand of assignment
   27 | if(m%j=0){
      |    ~^~
a.cc:39:2: error: expected '}' at end of input
   39 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<math.h>
 
using namespace std;
 
int main(){
 
int n;
int p=0;
cin>>n;

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

cin>>m;

double mt=m;
if(m==2) {
p++;
continue;
}
else if( m<2 || m%2==0)continue;

int t=0;
double sqr=sqrt(mt);
for(int j=3;j<=sqr;j++){
if(m%j=0){
t++;
break;
}

if(t==0)p++;
}
 
cout<<p<<endl;
 
return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: lvalue required as left operand of assignment
   28 | if(m%j=0){
      |    ~^~
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<math.h>
 
using namespace std;
 
int main(){
 
int n;
int p=0;
cin>>n;

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

cin>>m;


if(m==2) {
p++;
continue;
}
else if( m<2 || m%2==0)continue;

int t=0;
double sqr=sqrt(m);
for(int j=3;j<=sqr;j++){
if(m%j=0){
t++;
break;
}

if(t==0)p++;
}
 
cout<<p<<endl;
 
return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: lvalue required as left operand of assignment
   28 | if(m%j=0){
      |    ~^~
a.cc:40:2: error: expected '}' at end of input
   40 | }
      |  ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^