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

#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>

// #include <string>
// #define REP(i, n) for(int i = 0; i < (int)n; i++)
// #define MOD 1000000009
// using namespace std;
// typedef long long ll;
int main()
{
  int n;
  cin >> n;
  if(n %2 == 0)  {cout << 0.50 << endl;}
  else{ cout << double(n + 1)/2 << endl;}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   13 |   cin >> n;
      |   ^~~
      |   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:19: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   if(n %2 == 0)  {cout << 0.50 << endl;}
      |                   ^~~~
      |                   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:14:35: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   if(n %2 == 0)  {cout << 0.50 << endl;}
      |                                   ^~~~
      |                                   std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   else{ cout << double(n + 1)/2 << endl;}
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:36: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   else{ cout << double(n + 1)/2 << endl;}
      |                                    ^~~~
      |                                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include <stdio.h>

int main(){
  int input;
  float probability;
  scanf("%d", &input);
  if(input%2==0)
    return probability = 1/2;
  else{
    return probability = (int(input/2)+1)/input;
  }
}


Compiler output:
main.c: In function 'main':
main.c:10:31: error: expected ')' before 'input'
   10 |     return probability = (int(input/2)+1)/input;
      |                               ^~~~~
      |                               )
main.c:10:39: error: expected ')' before '+' token
   10 |     return probability = (int(input/2)+1)/input;
      |                          ~            ^
      |                                       )
Language: C

#include <stdio.h>

int main(){
  int input;
  float probability;
  scanf("%d", &input);
  if(input%2==0)
    return probability = 1/2;
  else{
    return probability = (int(n/2)+1)/n;
  }
}


Compiler output:
main.c: In function 'main':
main.c:10:31: error: expected ')' before 'n'
   10 |     return probability = (int(n/2)+1)/n;
      |                               ^
      |                               )
main.c:10:35: error: expected ')' before '+' token
   10 |     return probability = (int(n/2)+1)/n;
      |                          ~        ^
      |                                   )
main.c:10:39: error: 'n' undeclared (first use in this function)
   10 |     return probability = (int(n/2)+1)/n;
      |                                       ^
main.c:10:39: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdout.h>

int main(){
  int input;
  float probability;
  scanf("%d", &input);
  if(input%2==0)
    return probability = 1/2;
  else{
    return probability = (int(n/2)+1)/n;
  }
}

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

#include<iostream>
int main(){
  int n;
  std::cin >> n;
  double p;
  if(n%2 = 0) p = 0.5;
  else p = (n+1)/(2*n);
  
  std::cout << p;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: lvalue required as left operand of assignment
    6 |   if(n%2 = 0) p = 0.5;
      |      ~^~
Language: C++

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

int main(){
  int N;
  cin >> N;
  if(N%2 == 0){
    double k = (double)N;
    cout << k/2/k <<endl;
  }else{
    double l = (double)N;
    cout << (k+1)/2/k <<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'k' was not declared in this scope
   12 |     cout << (k+1)/2/k <<endl;
      |              ^
Language: C++

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

int main(){
  double N;
  cin >> N;
  if(N%2 == 0){
    cout << N/2/N <<endl;
  }else{
    cout << (N+1)/2/N <<endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    7 |   if(N%2 == 0){
      |      ~^~
      |      | |
      |      | int
      |      double
Language: C++

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

int main(){
 int a, b;
 int result;
  
 cin >> a >> b;
 if(a > b+b){
  cout << a - b+b; << endl; 
 }else{
  cout << 0 << endl; 
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected primary-expression before '<<' token
   10 |   cout << a - b+b; << endl;
      |                    ^~
Language: C++

int main(void) {
	int N;
	std::cin >> N;
	//std::cout << N / 2 << std::endl;
	int odd, even;
	if (N % 2 == 0) {
		odd = even = N / 2;
	}
	else {
		odd = N / 2;
	}
	float res;
	res = static_cast<float>(odd) / static_cast<float>(N);
	std::cout << res;
	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:3:14: error: 'cin' is not a member of 'std'
    3 |         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 | int main(void) {
a.cc:14:14: error: 'cout' is not a member of 'std'
   14 |         std::cout << res;
      |              ^~~~
a.cc:14:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:18: error: expected '}' at end of input
   15 |         return 0;
      |                  ^
a.cc:1:16: note: to match this '{'
    1 | int main(void) {
      |                ^
Language: Java

import java.util.Scanner;

public class Main throw Exception{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];

		for(int i = 0; i < a.length; i ++) {
			a[i] = sc.nextInt();
		}

		int count = 1;

	do {
		for(int i = 0; i < a.length; i++) {
			if(a[i]==count) {
				count++;
				b[i] = i+1;
				System.out.print(b[i]+" ");
			}
		}
	}while(count!=n+1);


	}

}


Compiler output:
Main.java:3: error: '{' expected
public class Main throw Exception{
                 ^
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
  	Scanner stdIn = new Scanner(System.in);
    	int a = stdIn.nextInt();
    	int kisuu = 0;
    		for(int i = 1; i < a; i++){
              if(i%2!=0){
                kisuu++;
              }
         System.out.println(kisuu/a);
            }
  }
           

Compiler output:
Main.java:13: error: reached end of file while parsing
  }
   ^
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
  	Scanner stdIn = new Scanner(System.in);
    	int a = stdIn.nextInt();
    	int kisuu = 0;
    		for(int i = 0; i < a; i++){
              if(i%2!=0){
                kisuu++;
              }
         System.out.println(kisuu/a);
            }
  }
                
                
  		

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  int a;
  cin >> n;
  a = (n+1)/2
  cout << a/n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before 'cout'
    8 |   a = (n+1)/2
      |              ^
      |              ;
    9 |   cout << a/n << endl;
      |   ~~~~
Language: C++

#include <iostream>


using namespace std;
int main()
{
	int N;
	cin >> N;
	double P = ceil(N / 2.0);
	printf("%f\n", P/N);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: 'ceil' was not declared in this scope
    9 |         double P = ceil(N / 2.0);
      |                    ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int N;
	cin >> N;
	double P = ceil(N / 2.0);
	cout << (P/N);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'ceil' was not declared in this scope
    7 |         double P = ceil(N / 2.0);
      |                    ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int N;
	cin >> N;
	cout << ceil((double)N / 2.0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'ceil' was not declared in this scope
    7 |         cout << ceil((double)N / 2.0);
      |                 ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int N;
	cin >> N;
	cout << ceil(N / 2.0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'ceil' was not declared in this scope
    7 |         cout << ceil(N / 2.0);
      |                 ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int n;
   scanf("%d",&n);
  if(n%2==0)
        printf("%.10lf\n",double(n/2)/n);
  else 
       printf("%.10lf\n",double((n/2)+1)/n));
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:44: error: expected ';' before ')' token
   10 |        printf("%.10lf\n",double((n/2)+1)/n));
      |                                            ^
      |                                            ;
Language: C++

#include<stdio.h>

int main(){    
    int n;
    scanf("%d",&n);
    printf("%f",(double)(n-n/2)n);
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:6:32: error: expected ')' before 'n'
    6 |     printf("%f",(double)(n-n/2)n);
      |           ~                    ^
      |                                )
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int N;
 
void solve() {
    cin >> N;
    cout.precision(10);
    cout << (double)(N - N / 2) / (double)N << endl;
    return;
}
 
int main() {
    solve();
    return 0;

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

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

int N;

void solve() {
  	cin >> N;
  	cout.precision(10);
  	cout << (double)(N - N/2) /(double)N << endl;
}
int main(){
    solve():
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected ';' before ':' token
   12 |     solve():
      |            ^
      |            ;
Language: C++

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

	int N;

void solve() {
  
	cin >> N;
  	cout.precision(10);
  	cout << (double)(N - N/2) /(double)N << endl;
}
int main(){
    solve():
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected ';' before ':' token
   13 |     solve():
      |            ^
      |            ;
Language: C++

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

void solve() {
  	int N;
	cin >> N;
  	cout.precision(10);
  	cout << (double)(N - N/2) /(double)N << endl;
}
int main(){
    solve():
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before ':' token
   11 |     solve():
      |            ^
      |            ;
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    double counter = 0;
    for(int i = 0;i <= a;i++){
      int b = i % 2;
      if(b == 1){
        counter++;
      }
      System.out.println((double)a/counter);
    }
  }

Compiler output:
Main.java:14: error: reached end of file while parsing
  }
   ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    double counter;
    for(int i = 0;i <= a;i++){
      int b = i % 2;
      if(b == 1){
        counter++;
      }
      System.out.println((double)a/counter);
    }
  }
}

Compiler output:
Main.java:10: error: variable counter might not have been initialized
        counter++;
        ^
Main.java:12: error: variable counter might not have been initialized
      System.out.println((double)a/counter);
                                   ^
2 errors
Language: C++

#include<iostream>
using namespace std;
int main(){
  double n;cin>>n;
  if(n%2.0==0)cout<<0.5<<endl;
  else cout<<((n/2)+1)/n<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: invalid operands of types 'double' and 'double' to binary 'operator%'
    5 |   if(n%2.0==0)cout<<0.5<<endl;
      |      ~^~~~
      |      | |
      |      | double
      |      double
Language: C

#include<stdio.h>

  int a,j;
  float n;
int main(void)
{scanf("%d",&a);
 
for(i=0;i<=a;i++){
  	if(i%2==1){
    	j++;
    	}
}
 n=j%a;
printf("%f",n);
}
 
 

Compiler output:
main.c: In function 'main':
main.c:8:5: error: 'i' undeclared (first use in this function)
    8 | for(i=0;i<=a;i++){
      |     ^
main.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(){
  int N;
  scanf("%d"&N);
printf("%f",(float)(N/2+N%2)/(N/2));
}

Compiler output:
main.c: In function 'main':
main.c:4:13: error: invalid operands to binary & (have 'char *' and 'int')
    4 |   scanf("%d"&N);
      |         ~~~~^
      |         |
      |         char *
Language: C++

#include <stdio.h>
int main(){
  int N;
  scanf("%d"&N);
printf("%f",(float)(N+N%2)/N);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
    4 |   scanf("%d"&N);
      |         ~~~~^~
      |         |    |
      |         |    int
      |         const char [3]
Language: C

#include <stdio.h>
int main()
{
  int N,;
  double a;
  scanf("%d",&N);
  if(N%2==0)
  {
  	a=N/2.0;
    printf("%f",a);
  }
  else if(N%2==1)
  {
  	a=(N+1)/2.0;
      printf("%f",a);
  }
}

Compiler output:
main.c: In function 'main':
main.c:4:9: error: expected identifier or '(' before ';' token
    4 |   int N,;
      |         ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    double count = 0;
    for(int i=1;i<N+1;i++){
        if(i % 2 != 0){
            count += 1;
        }
    }
    cout << count / 100;
   

    return 0;
}

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

#include <iostream>
#include <iomanip>
using namespace std;
int main(){	
	double N,num=0.0000000000;
	double jl;
	cin>>N;
	for(int i=1;i<=N;i++){
		if(i%2==1)num++;			
	}
	jl=(num*1.0000000000)/(N*1.000000000);
	cout<<fixed<<setprecision(10)<<jl<<endl;
}


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

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

vector<long long> prime_factor( long long n);
int main() {
    long long A,B,t;
    long long count = 0;
    vector<int> P ;
    
    cin >> A >> B;
    t= __gcd(A,B);
    P = prime_factor(t);
    
    cout << P.size() + 1;

    return 0;
}


vector<long long> prime_factor( long long n){
    vector<long long> res;
    for(long long i=2;i*i <= n;i++){
        if(n%i == 0){
            res.push_back(i);
            while(n%i == 0) n/=i;
        }
    }
    if(n != 1) res.push_back(n);
    return res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'std::vector<long long int>')
   15 |     P = prime_factor(t);
      |                       ^
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'std::vector<long long int>' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++>

using namespace std;

int main() {
  int n;
  cin >> n;
  int o = 0;
  for(int i = 0; i <= n; i++) {
    if(i % 2 == 0) {
      ++o;
    }
  }
  int ans;
  if(ans != 0) {
    ans = o / n;
  }
  else {
    ans = 0;
  }
  
  cout << ans;
  
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdc++: No such file or directory
    1 | #include <bits/stdc++>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++>

using namespace std;

int main() {
  int n;
  cin >> n;
  int e = 0;
  for(int i = 1; i < n; i++) {
    if(i % 2 == 0) {
      ++e;
    }
  }
  int ans = e / (n -1);
  
  cout << ans;
  
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdc++: No such file or directory
    1 | #include <bits/stdc++>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++>

using namespace std;

int main() {
  int n;
  cin >> n;
  int o = 0;
  for(int i = 0; i < n; i++) {
    if(i % 2 == 0) {
      ++e;
    }
  }
  int ans = e / (n -1);
  
  cout << ans;
  
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: bits/stdc++: No such file or directory
    1 | #include <bits/stdc++>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N;
  cin >> N;
  cout << ceil(N/2) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'ceil' was not declared in this scope
    7 |   cout << ceil(N/2) << endl;
      |           ^~~~
Language: C

#include<iostream>
using namespace std;

int main()
{ int n;
  float a,k=0.0;
  cin>>n;
  for( int i=0;i<=n;i++){
	  if(i%2==1)
		  k++;}
  a=k/n;
  printf("%.10f\n",a);
}



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

#include<stdio.h>
int main(void){
  int n;
  scanf("%d",&n);
  if(n%2 == 0){
    p = 1/2;
  }else{
    p = (n+1)/(2*n);
  }
  printf("%10.9lf",p);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:5: error: 'p' undeclared (first use in this function)
    6 |     p = 1/2;
      |     ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N;
    cin >> N;
    cout << fixed << setprecisoin(15);
    cout <<((N % 2 == 0) ? 0.5 : 0.5 + 1.0 / N)  << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'setprecisoin' was not declared in this scope
    9 |     cout << fixed << setprecisoin(15);
      |                      ^~~~~~~~~~~~
Language: C++

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

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int N;
    cin >> N;
    cout << fixed << setprecisoin(15);
    cout << (N % 2 == 0) ? 0.5 : 0.5 + 1.0 / N << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: 'setprecisoin' was not declared in this scope
    9 |     cout << fixed << setprecisoin(15);
      |                      ^~~~~~~~~~~~
a.cc:10:48: error: invalid operands of types 'double' and '<unresolved overloaded function type>' to binary 'operator<<'
   10 |     cout << (N % 2 == 0) ? 0.5 : 0.5 + 1.0 / N << endl;
      |                                  ~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include <iostream>
#include <bits\stdc++.h>

using namespace std;

int main()
{
	long long n;
	cin>>n; double t=n;
	if (n%2==0) cout<<fixed<<setprecision(10)<<t/(2*t);
	else if (n!=1) cout<<fixed<<setprecision(10)<<((t/2)+1)/t;
	else cout<<fixed<<setprecision(10)<<t;
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: bits\stdc++.h: No such file or directory
    2 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <bits\stdc++.h>

using namespace std;

int main()
{
	long long n;
	cin>>n; double t=n;
	if (n%2==0) cout<<fixed<<setprecision(10)<<t/(2*t);
	else cout<<fixed<<setprecision(10)<<((t/2)+1)/t;
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: bits\stdc++.h: No such file or directory
    2 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main(){
    int N;
    cin >> N;
    double ans;
    if(N % 2 == 0){
        ans = N / (2 * N)
    } else {
        ans = (N + 1) / (2 * N);
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before '}' token
    9 |         ans = N / (2 * N)
      |                          ^
      |                          ;
   10 |     } else {
      |     ~
Language: C++

include <iostream>

using namespace std;

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

    // odd numbers <= n:
    int odd = (n + 1) / 2;
    cout << (double)odd / n;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> n;
      |     ^~~
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout << (double)odd / n;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double N ;
  cin >> N;
   //cout << setprecision(15) << (double)1/3 << endl;
  //cout << (double)1/3 << endl;
  if (N%2==1) {
    cout << (N+1.0)*0.5/N << endl;
  }
  else {
  cout << 1.0/2.0 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    9 |   if (N%2==1) {
      |       ~^~
      |       | |
      |       | int
      |       double
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N ;
  if(N%2=0){
    cout << "0.500000000" << endl;
  }else{
    cout << 0.5 + 1/(2*N) <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: lvalue required as left operand of assignment
    7 |   if(N%2=0){
      |      ~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N ;
  if(N % 2 =0){
    cout << "0.500000000" << endl;
  }else{
    cout << 0.5 + 1/(2*N) <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: lvalue required as left operand of assignment
    7 |   if(N % 2 =0){
      |      ~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  cin >> N ;
  if(N % 2 =0){
    cout << "0.500000000" << endl;
  }else{
    cout << 0.5 + 1/(2*N) <<endl;
  }
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  cin >> N ;
  if(N % 2 =0){
    cout << "0.500000000" << endl;
  }else{
    cout << 0.5 + 1/(2*N) <<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'N' was not declared in this scope
    5 |   cin >> N ;
      |          ^
a.cc:11:2: error: expected '}' at end of input
   11 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<dits/stdc++.h>
uding namespace std;

int main(){
  double d;
  cin>>d;
  cout<<1/d<<endl;
}

Compiler output:
a.cc:1:9: fatal error: dits/stdc++.h: No such file or directory
    1 | #include<dits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  float n;
  cin >> n;
  if (n & 1) cout << (n + 2) / (2.0 * n) << '\n';
  else cout << n / (2.0 * n) << '\n';
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: invalid operands of types 'float' and 'int' to binary 'operator&'
    7 |   if (n & 1) cout << (n + 2) / (2.0 * n) << '\n';
      |       ~ ^ ~
      |       |   |
      |       |   int
      |       float
Language: C++

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

int main() {
  float n;
  cin >> n;
  if (n & 1) cout << (n + 2) / (2.0 * n) << '\n';
  else cout << n / (2.0 * n) << '\n';
  return 0;
}

Compiler output:
a.cc:1:25: error: missing terminating > character
    1 | #include <bits/stdc++.h.
      |                         ^
a.cc:1:10: fatal error: bits/stdc++.h.: No such file or directory
    1 | #include <bits/stdc++.h.
      |          ^
compilation terminated.
Language: C

#include<stdio.h>

int main(void) {
  int n;
  
  scanf("%d",&n);
  
  printf("%d", n/2n);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:18: error: invalid suffix "n" on integer constant
    8 |   printf("%d", n/2n);
      |                  ^~
Language: C

#include<stdio.h>

int main(void) {
  int n;
  
  scanf("%d",n);
  
  printf("%d", n/2n);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:18: error: invalid suffix "n" on integer constant
    8 |   printf("%d", n/2n);
      |                  ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int a;
    cin >> a;
    float ans;
    if (a%2 == 0){
        ans = 0.5f
    }
    else{
        int b = a/2;
        ans = (float)(b+1)/a;
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '}' token
    9 |         ans = 0.5f
      |                   ^
      |                   ;
   10 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int a;
    cin >> a;
    float ans;
    if (a%2 == 0){
        ans = 0.5f
    }
    else{
        int b = a/2;
        ans = (float)(b+1)/a;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '}' token
    9 |         ans = 0.5f
      |                   ^
      |                   ;
   10 |     }
      |     ~
Language: C++

#include <iostream>
using namespace std;

int main()
{
    int a;
    cin >> a;
    float ans;
    if (a%2 == 0){
        ans = 0.5f
    }
    else{
        int b = a/2;
        ans = (float)(b+1)/a;
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '}' token
   10 |         ans = 0.5f
      |                   ^
      |                   ;
   11 |     }
      |     ~
Language: C++

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

int main()
{
    int a;
    cin >> a;
    float ans;
    if (a%2 == 0){
        ans = 0.5f
    }
    else{
        int b = a/2;
        ans = (float)(b+1)/a;
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: expected ';' before '}' token
   10 |         ans = 0.5f
      |                   ^
      |                   ;
   11 |     }
      |     ~
Language: C++

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

int main(){
    int a = 0;
    cin >> a;
    float ans = 0;
    if (a%2 == 0){
        ans = 0.5f
    }
    else{
        int b = a/2;
        ans = (float)(b+1)/a;
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '}' token
    9 |         ans = 0.5f
      |                   ^
      |                   ;
   10 |     }
      |     ~
Language: C++

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

int main(){
    int a = 0;
    cin >> a;
    float ans;
    if (a%2 == 0){
        ans = 0.5f
    }
    else{
        int b = a/2;
        ans = (float)(b+1)/a;
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '}' token
    9 |         ans = 0.5f
      |                   ^
      |                   ;
   10 |     }
      |     ~
Language: C++

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

int main(){
    int a;
    cin >> a;
    float ans;
    if (a%2 == 0){
        ans = 0.5f
    }
    else{
        int b = a/2;
        ans = (float)(b+1)/a;
    }
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '}' token
    9 |         ans = 0.5f
      |                   ^
      |                   ;
   10 |     }
      |     ~
Language: C++

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

int main() {
 int n;
 cin >> n;
 if(n%2==0) cout << "0.5" << endl;
 int k=n+1;
 n*=2;
 double ans=k/n
 if(n%2 == 1) cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:2: error: expected ',' or ';' before 'if'
   11 |  if(n%2 == 1) cout << ans << endl;
      |  ^~
Language: C++

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

int main() {
 double n;
 cin >> n;
 if(n%2==0) cout << "0.5" << endl;
 int k=n+1;
 n*=2;
 if(n%2 == 1) cout << k/n << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    7 |  if(n%2==0) cout << "0.5" << endl;
      |     ~^~
      |     | |
      |     | int
      |     double
a.cc:10:6: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   10 |  if(n%2 == 1) cout << k/n << endl;
      |     ~^~
      |     | |
      |     | int
      |     double
Language: Java

import java.util.*;
public class Main{

public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  double N = (double)sc.nextLine();
  System.println((N - N/2) / N);
}
}

Compiler output:
Main.java:6: error: incompatible types: String cannot be converted to double
  double N = (double)sc.nextLine();
                                ^
Main.java:7: error: cannot find symbol
  System.println((N - N/2) / N);
        ^
  symbol:   method println(double)
  location: class System
2 errors
Language: Java

import java.util.*;
public class Main{

public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  double N = sc.nextLine();
  System.println((N - N/2) / N);
}
}

Compiler output:
Main.java:6: error: incompatible types: String cannot be converted to double
  double N = sc.nextLine();
                        ^
Main.java:7: error: cannot find symbol
  System.println((N - N/2) / N);
        ^
  symbol:   method println(double)
  location: class System
2 errors
Language: Java

import java.util.*;
public call Main{

public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  double N = sc.nextLine();
  System.println((N - N/2) / N);
}
}

Compiler output:
Main.java:2: error: class, interface, enum, or record expected
public call Main{
       ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
              ^
  (use --enable-preview to enable unnamed classes)
Main.java:9: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.*;

public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  double N = sc.nextLine();
  System.println((N - N/2) / N);
}

Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args){
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include<iostream>
using namespace std;

int main(){
  float n;

  cin>>n;

  if (n%2==0){
    cout<<n/(2*n);
  } else {
    cout<<(n+1)/(2*n);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: invalid operands of types 'float' and 'int' to binary 'operator%'
    9 |   if (n%2==0){
      |       ~^~
      |       | |
      |       | int
      |       float
Language: C++

#include<iostream>
using namespace std;

int main(){
  float n;
  float odd;

  cin>>n;

  if (n%2==0){
    cout<<n/(2*n);
  } else {
    cout<<(n+1)/(2*n);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: invalid operands of types 'float' and 'int' to binary 'operator%'
   10 |   if (n%2==0){
      |       ~^~
      |       | |
      |       | int
      |       float
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n;
  int odd;
  
  cin>>n;
  odd=2*n-1
  
  if (n%2==0){
    cout<<n/2*n;
  } else {
    cout<<n/odd;
  }
  return 0
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: expected ';' before 'if'
    9 |   odd=2*n-1
      |            ^
      |            ;
   10 | 
   11 |   if (n%2==0){
      |   ~~        
a.cc:13:5: error: 'else' without a previous 'if'
   13 |   } else {
      |     ^~~~
a.cc:16:11: error: expected ';' before '}' token
   16 |   return 0
      |           ^
      |           ;
   17 | }
      | ~
Language: C++

//------------------------------------------
// C++ templete 
//------------------------------------------
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
using ll = long long;

#define endl "\n"

//typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

//REPEAT
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//container util
//------------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define PRINT(V) for (auto v : (V)) cout << v << " "
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())

//constant
//------------------------------------------
const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

//math
//------------------------------------------
int QP(int a,int b){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int QP(int a,int b,int MOD){int ans=1;do{if(b&1)ans=1ll*ans*a%MOD;a=1ll*a*a%MOD;}while(b>>=1);return ans;}
int GCD(int a,int b){return b?GCD(b,a%b):a;}

//debug
//------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//動的計画法で役に立つ関数
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

//最大公約数と最小公倍数
ll gcd(ll a, ll b) {
    if(b==0)return a;
    return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
  ll g = gcd(a, b);
  return a/g*b;
}

vector<vector<long long> > comb(int n) {
  vector<vector<long long> > v(n + 1,vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}

int N;

int main() 
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    cin >> N;
    if (N%2==0) cout << (double).5 << endl;
    else cout << (double)((N-N/2/N) << endl;
  
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:91:37: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   91 |     else cout << (double)((N-N/2/N) << endl;
      |                           ~~~~~~~~~ ^~
      |                             |
      |                             int
a.cc:91:44: error: expected ')' before ';' token
   91 |     else cout << (double)((N-N/2/N) << endl;
      |                          ~                 ^
Language: C

#include<stdio.h>
#include<conio.h>
int main()
{
  int n,c;
  scanf("%d",&n);
  if(n%2==0)
    c=(n/2)/n;
  else
    c=((n/2)+1)/n;
  printf(c);
  return 0;
}
  

Compiler output:
main.c:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace td;
int main()
  
{
  int n,res;
  res=(floor(n/2))/n;
  cout<<res;
  return 0;
}

Compiler output:
a.cc:2:17: error: 'td' is not a namespace-name
    2 | using namespace td;
      |                 ^~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    8 |   cout<<res;
      |   ^~~~
      |   std::cout
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:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	
	double N;
	double a = 0;
	double probability;
	
	cin >> N;
	
	if ((N <= 100) || (1 <= N)) {
		for (int i = 0; i <= N; i++) {
			if (i % 2 != 0){
				at++;
			}
		}
		probability = a / N;
		cout << probability;
	}
	
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:33: error: 'at' was not declared in this scope; did you mean 'a'?
   15 |                                 at++;
      |                                 ^~
      |                                 a
Language: C++

#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	
	float number;
	float count = 0;
	float probability;
	
	cin >> number;
	
	if ((number <= 100) || (0 <= number)) {
		for (int i = 0; i <= number; i++) {
			if (i % 2 != 0){
				count++;
			}
		}
		probability = count / number;
		cout << probability;
	}
	
}#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	
	float number;
	float count = 0;
	float probability;
	
	cin >> number;
	
	if ((number <= 100) || (0 <= number)) {
		for (int i = 0; i <= number; i++) {
			if (i % 2 != 0){
				count++;
			}
		}
		probability = count / number;
		cout << probability;
	}
	
}

Compiler output:
a.cc:22:2: error: stray '#' in program
   22 | }#include <iostream>
      |  ^
a.cc:22:3: error: 'include' does not name a type
   22 | }#include <iostream>
      |   ^~~~~~~
a.cc:25:5: error: redefinition of 'int main(int, char**)'
   25 | int main(int argc, char *argv[]) {
      |     ^~~~
a.cc:4:5: note: 'int main(int, char**)' previously defined here
    4 | int main(int argc, char *argv[]) {
      |     ^~~~
Language: C++

#include<stdio.h>
int main(){
  double n;
  double k=1/2;
  scanf("%lf", &n);
  if(n%2==0){
    printf("%f", k)
      ;
    }
  else{
    printf("%f", (n+1)/2/n);
    }
  return 0;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    6 |   if(n%2==0){
      |      ~^~
      |      | |
      |      | int
      |      double
Language: C++

#include<stdio.h>
int main(){
  double n;
  scanf("%lf", &n);
  
  if(n%2==0){
    printf("%f", 1/2);
    }
  /*
  else{
    printf("%f", k/n);
    }
  return 0;
  */
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    6 |   if(n%2==0){
      |      ~^~
      |      | |
      |      | int
      |      double
Language: C++

#include<stdio.h>
int main(){
  double n;
  scanf("%lf", &n);
  double k=(n+1)/2;
  if(n%2==0){
    printf("%f", 1/2);
    }
  else{
    printf("%f", k/n);
    }
  return 0;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    6 |   if(n%2==0){
      |      ~^~
      |      | |
      |      | int
      |      double
Language: C++

#include<stdio.h>
int main(){
  double n;
  scanf("%lf", &n);
  if(n%2==0){
    printf("%f", 1/2);
    }
  else{
    printf("%f", (n+1)/2/n);
    }
  return 0;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    5 |   if(n%2==0){
      |      ~^~
      |      | |
      |      | int
      |      double
Language: C++

#include<stdio.h>
int main(){
  double n;
  scanf("%lf", &n);
  if(n%2==0){
    printf("%f", 1/2);
    }
  else{
    printf("%f", (n+1)/2/n);
    }
  return 0;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:7: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    5 |   if(n%2==0){
      |      ~^~
      |      | |
      |      | int
      |      double
a.cc:11:12: error: expected '}' at end of input
   11 |   return 0;
      |            ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
using namespace std;
int main()
{
    int n;
    cin >> n;
    double ans;
    if (n == 1)
    {
        ans = 1.0 / 1;
        cout << setprecision(6) << ans << endl;
    }
    else if (n % 2 == 0)
    {
        ans = 1.0 / 2;
        cout << setprecision(6) << ans << endl;
    }
    else if (n % 2 == 1 && n != 1)
    {
        ans = ((n / 2)/(double)n;
        cout << setprecision(6) << ans << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:33: error: expected ')' before ';' token
   24 |         ans = ((n / 2)/(double)n;
      |               ~                 ^
      |                                 )
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
using namespace std;
int main()
{
    double n;
    cin >> n;
    double ans;
    if (n == 1)
    {
        ans = 1.0 / 1;
        cout << setprecision(6) << ans << endl;
    }
    if (n % 2 == 0)
    {
        ans = 1.0 / 2;
        cout << setprecision(6) << ans << endl;
    }
    if (n % 2 == 1 || n != 1)
    {
        ans = (n - 1.0 / 2) + 1;
        cout << setprecision(6) << ans << endl;
    }
    cout << n << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   17 |     if (n % 2 == 0)
      |         ~ ^ ~
      |         |   |
      |         |   int
      |         double
a.cc:22:11: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   22 |     if (n % 2 == 1 || n != 1)
      |         ~ ^ ~
      |         |   |
      |         |   int
      |         double
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N; cin>>N
  float ans=(float)((N+1)/2)/(float)N;
  cout>>ans>>endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:16: error: expected ';' before 'float'
    4 |   int N; cin>>N
      |                ^
      |                ;
    5 |   float ans=(float)((N+1)/2)/(float)N;
      |   ~~~~~         
a.cc:6:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
    6 |   cout>>ans>>endl;
      |         ^~~
      |         abs
Language: C++

#include<stdio.h>

int main(){
    int n;
    double p;
    if(n%2=0) p=1/2.0;
    else p=(n+1)/(2.0*n);
    printf("%d",p);
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: lvalue required as left operand of assignment
    6 |     if(n%2=0) p=1/2.0;
      |        ~^~
Language: C++

#include<iostream>
using namespace std;

int main(){
  double N = 0, M = 0;
  cin >> N;
  for (int i = 0; i <= N; i++){
    if (i/2 % 1){
      M++;
    }
  }
  cout << set(10) << M/N << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'set' was not declared in this scope
   12 |   cout << set(10) << M/N << endl;
      |           ^~~
a.cc:2:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    1 | #include<iostream>
  +++ |+#include <set>
    2 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

int main(){
  float N = 0, M = 0;
  cin >> N;
  for (int i = 0; i < N; i++){
    if (i/2 %= 1) M++;
  }
  cout << M/N << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: lvalue required as left operand of assignment
    8 |     if (i/2 %= 1) M++;
      |         ~^~
Language: C

#include <stdio.h>

/*long gcd(long x, long y) {
	if (y == 0) return x;
	return gcd(y, x%y);
}*/

int main() {
	long A, B, G_Common, k, cmt, i, j;
	scanf("%ld %ld",&A,&B);
	//G_Common = gcd(A,B);
	while ((k = A%B) > 0) {
		A = B;
		B = k;
	}

	G_Common = B;
	for (i = 2; G_Common > 1 && G_Common >= i*i; ) {
		for (j = 0; G_Common % i == 0; j++) G_Common /= i;
		if (j > 0) cnt++;
		if (i == 2) i++;
		else i += 2;
	}
	if (G_Common >= i) cnt++; //残りの素因数が2乗より小さい時
	printf("%ld\n",cnt);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:28: error: 'cnt' undeclared (first use in this function); did you mean 'cmt'?
   20 |                 if (j > 0) cnt++;
      |                            ^~~
      |                            cmt
main.c:20:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include "Header.h"
using namespace std;
int main() {
	double imput;
	double answer;
	cin >> imput;
	answer = ((imput + 1) / 2) / imput;
	cout << answer;
}

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