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

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected ',' or ';' before 'if'
    7 |   if(A % 2 = 0) {
      |   ^~
a.cc:10:3: error: 'else' without a previous 'if'
   10 |   else {
      |   ^~~~
Language: C++

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


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

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

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




#include <cstdio>
int main()
{
    int n;
    scanf("%d", &n);
    if (n % 2 == 0) 
        printf("0.5\n");
    else 
        printf("%lf", (double)(n/2+1) / n)

    return 0;
}       

Compiler output:
a.cc: In function 'int main()':
a.cc:12:43: error: expected ';' before 'return'
   12 |         printf("%lf", (double)(n/2+1) / n)
      |                                           ^
      |                                           ;
   13 | 
   14 |     return 0;
      |     ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  double a;
  cin>>a;
  if(a%2==0) {
cout<<0.50000000<<endl;
  }
else {
  cout<<fixed<<setprecision(7);
cout<<(a/2+1)/a<<endl;
}
}

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

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


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

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

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) cout<<(n/2)/n;
      |      ~^~
      |      | |
      |      | int
      |      double
Language: C

#include<stdio.h>
int main(void)
{
	int n;
	scanf("%d",&n);
	if(n==1)
	puts("1.0");
	else if(n/2==0)
	puts("0.5");
	
	else{
		
		double m;
		double x=0;
		int i;
		for(i=1; i<=n; i++){
			if(i%2==1)
			x++;
		}
		m=x/n;
		printf("%lf",m);
	}
	
	
	
	getch();
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:9: error: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
   26 |         getch();
      |         ^~~~~
      |         getc
Language: C++

#include <bits/stdc++.h>
using namespace std;
void print() {
    cout << endl;
}
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
    cout << head;
    if (sizeof...(tail) != 0)
        cout << " ";
    print(forward<Tail>(tail)...);
}
template <class T>
void print(vector<T> &vec) {
    for (auto &a : vec) {
        cout << a;
        if (&a != &vec.back())
            cout << " ";
    }
    cout << endl;
}
template <class T>
void print(vector<vector<T>> &df) {
    for (auto &vec : df) {
        print(vec);
    }
}
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
using ll = long long;
const int INF = 1001001001;

int main() {
    double N;
    cin >> N;
    double cnt = 0;
    xrep(n,1, N) {
        if(n%2==1 ++cnt;
    }
    printf("%.10f", cnt/N);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: lvalue required as increment operand
   38 |         if(n%2==1 ++cnt;
      |                 ^
a.cc:39:5: error: expected primary-expression before '}' token
   39 |     }
      |     ^
a.cc:38:25: error: expected ')' before '}' token
   38 |         if(n%2==1 ++cnt;
      |           ~             ^
      |                         )
   39 |     }
      |     ~                    
a.cc:39:5: error: expected primary-expression before '}' token
   39 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
 double a;
 cin >> a;
 if(a%2.0==0){
   cout << "0.5000000000" << endl;
 }
  else cout << (a+1)/a << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
 double a;
 cin >> a;
 if(a%2==0){
   cout << "0.5000000000" << endl;
 }
  else cour << (a+1)/a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    6 |  if(a%2==0){
      |     ~^~
      |     | |
      |     | int
      |     double
a.cc:9:8: error: 'cour' was not declared in this scope
    9 |   else cour << (a+1)/a << endl;
      |        ^~~~
Language: Java

import java.util.Arrays;
import java.util.OptionalInt;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
import java.util.stream.Collectors;

public class HelloWorld {

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

        int N = sc.nextInt();

        int oddCnt = N / 2 + N % 2;

        double ret = oddCnt / (double)N;
        System.out.print(ret);
    }
}
//[B@25618e91
//[B@326de728
//

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

#include<bits/stdc++.h>
#define ll long long int

using namespace std;

const ll mod=1000000007;
const ll inf=1e18;

int main(){

  double n;
  cin >> n;
  if((ll)(n/1)%2==0)cout << 0.5 << endl;
  else if cout << 1 << endl;
  else{
    printf("%.12f",(n-1)/(2*n));
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected '(' before 'cout'
   14 |   else if cout << 1 << endl;
      |           ^~~~
      |           (
a.cc:15:3: error: 'else' without a previous 'if'
   15 |   else{
      |   ^~~~
Language: C++

n=int(input())
if n==0:
	p=0
	print("%.9f"%p)
elif n&1:
	p=(n//2)+1
	print("%.9f"%(p/n))
else:
	p=n//2
	print("%.9f"%(p/n))	

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

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


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

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

#include <stdio.h>
int main(void){
    float N;
    
    scanf("%f", &N);
    
    if(N == 1){
        printf("%f\n", N);
    }else if(N % 2 == 0){
        printf("%f\n", 2 / N);
    }else if(N % 2 == 1){
        printf("%f\n", 3 / N);
    }
}


Compiler output:
main.c: In function 'main':
main.c:9:16: error: invalid operands to binary % (have 'float' and 'int')
    9 |     }else if(N % 2 == 0){
      |                ^
main.c:11:16: error: invalid operands to binary % (have 'float' and 'int')
   11 |     }else if(N % 2 == 1){
      |                ^
Language: C++

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

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


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

#include <stdio.h>
int main(void){
    float N;
    
    scanf("%f", &N);
    
    if(N == 1){
        printf("%d\n", N);
    }else if(N % 2 == 0){
        printf("%d\n", 2 / N);
    }else if(N % 2 == 1){
        printf("%d\n", 3 / N);
    }
}


Compiler output:
main.c: In function 'main':
main.c:9:16: error: invalid operands to binary % (have 'float' and 'int')
    9 |     }else if(N % 2 == 0){
      |                ^
main.c:11:16: error: invalid operands to binary % (have 'float' and 'int')
   11 |     }else if(N % 2 == 1){
      |                ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n;
  cin >> n;
  cout << fixed << setprecision(6);
  if(n == 1)
    cout << n;
  else
    cout << (n / 2) / (float) n;
  cout << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'setprecision' was not declared in this scope
    8 |   cout << fixed << setprecision(6);
      |                    ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include <iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: expected ';' before numeric constant
    9 |     cout << (1 + N/2) / N.0 << endl;
      |                          ^~
      |                          ;
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected '}' before 'else'
   10 |   else {
      |   ^~~~
a.cc:8:17: note: to match this '{'
    8 |   if (N%2 == 1) {
      |                 ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    8 |   if (N%2 == 1) {
      |       ~^~
      |       | |
      |       | int
      |       double
a.cc:10:3: error: expected '}' before 'else'
   10 |   else {
      |   ^~~~
a.cc:8:17: note: to match this '{'
    8 |   if (N%2 == 1) {
      |                 ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected '}' before 'else'
   10 |   else {
      |   ^~~~
a.cc:8:17: note: to match this '{'
    8 |   if (N%2 == 1) {
      |                 ^
a.cc:12:2: error: expected '}' at end of input
   12 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

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;
 
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
 
#define rep(i, a, b) for(lli i = a; i < (b); ++i)
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) lli((x).size())
#define wis cout<<endl<<"I already speak english, bitch"<<endl<<endl;
 
typedef long long int lli;
typedef vector<lli> vi;
typedef pair<lli,lli> ii;
typedef vector<ii> vii;
typedef pair<ii,lli> iii;
 
#define trace(args...) { string  _s =#args; replace(_s.begin(), _s.end(), ',',' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args);}
void err(istream_iterator<string> it){}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args){
    cout <<  *it  << " : " << a << endl;
    err(++it, args...);
}

int main(){
	int n; cin>>n;
	int odd=0,eve=0;
	rep(i,1,n+1){
		if(i%2=1) odd++;
		else eve++;
	}

	cout<<double((odd+0.0)/(n+0.0))<<endl;

	return 0;
}

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

// I make this just for fun because i'm done
// Aimi Haraguni >> Konomi Suzuki >> Yui >>  Ikimono Gakari >> Garnidelia >> Kalafina >> Eir Aoi.   .. dude? 
// problems that involves any kind of persistent data structures are the best of the best, are not them?
 
// #pragma GCC optimize ("Ofast,unroll-loops")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
 
#define pb emplace_back
#define ff  first
#define ss second
#define tm1 first
#define tm2 second.first
#define tm3 second.second
#define sz(x) ll(x.size())
#define all(v) (v).begin(), (v).end()
#define FER(i,a,b) for(ll i=ll(a); i< ll(b); ++i)
#define IFR(i,a,b) for(ll i=ll(a); i>=ll(b); --i )
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
 
#define N 31000000
// #define M 19
 
#define mod  100007
#define mod1 1000000007
#define mod2 1000000009
#define bas 987625403
#define sqr(x) (x)*(x)  
#define INF 2000000000
 
using namespace std;
using namespace __gnu_pbds;
 
typedef int ll;
typedef pair<ll, ll> ii;
typedef pair<ll, ii> tri;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef tree<pair<ll, ll>, null_type, less<pair<ll, ll>>, rb_tree_tag, tree_order_statistics_node_update> S_t;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
 
#define trace(...) fff(#__VA_ARGS__, __VA_ARGS__)
template<typename t> void fff(const char* x, t&& val1) { cout<<x<< " : "<<val1<<"\n";}
template<typename t1, typename... t2> void fff(const char* x, t1&& val1, t2&&... val2){
    const char* xd=strchr(x+1, ',');
    cout.write(x, xd-x)<<" : "<<val1<<" | ";
    fff(xd+1, val2...);
}

inline ll mul(ll a, ll b) { return (long long) a*b%mod;}
inline ll add(ll a, ll b) { return a+b < mod? a+b: a+b-mod;}
inline void Mul(ll &a, ll b) { a = (long long) a*b%mod;}
inline ll bpw(ll a, ll p){
	ll ret;
	for(ret = 1; p; p>>=1, Mul(a, a)) (p & 1) && (Mul(ret, a), 1);
	return ret;
}

static inline void read(ll &result) {
    bool minus = false;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-') break;
        if (ch >= '0' and ch <= '9') break;
        ch = getchar();
    }
    (ch == '-')? minus = true: result = ch-'0';
    while (true) {
        ch = getchar();
        if (ch < '0' or ch > '9') break;
        result = (result<<3)+ (result<<1) + (ch - '0');
    }
    if(minus) result=-result;
}

int main(){
	ll n; read(n);
  	ll a = n>>1; b = n-a;
  	cout<<fixed<<setprecision(10);	
  	cout<<1.0*b/n<<"\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:81:22: error: 'b' was not declared in this scope
   81 |         ll a = n>>1; b = n-a;
      |                      ^
Language: C++

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

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

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

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int a,b,c;
  double d;
  string s,t;
  cin >>a;
  d=(int)((a+1)/2)/a;
  cout <<;
}

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

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

int main() {
  double A;
  int N = A;
  int M = N / 2 + 1;
  if(A % 2 = 0){
    cout << 0.500000000 << endl;
  }
  else{
  cout << A / M << endl;
  }
}


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

#include <iostream>
using namespace std;
int main(void){
    int N;
    cin>>N;
    int count=0;
    for(int i=1; 1<=N; i++){
        if(i % 2 == 1){
            count++1;
        }
    }
    cout << (double)count/N << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before numeric constant
    9 |             count++1;
      |                    ^
      |                    ;
Language: C++

#include <iostream>
using namespace std;
int main(){
    int n, i, num;
    cin >> n;
    num = 0;
    for (i = 0; i >= n; i++){
        if (n % 2 != 0){
            num+=1;
        }
        else{
        }
    }
    (float)num = (float)(num / n);
    cout << num << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: lvalue required as left operand of assignment
   14 |     (float)num = (float)(num / n);
      |     ^~~~~~~~~~
Language: C++

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

int main() {
 double N;
 cin >> N;
 if(N%2==0){
   cout << 0.5 << endl;
 }
 else{
   cout << (N/2+1)/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){
      |     ~^~
      |     | |
      |     | int
      |     double
Language: C++

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

int main() {
 double N;
 cin >> N;
 if(N%2==0){
   cout << 0.5 << endl;
 }
 else{
   cout << (N/2+1)/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){
      |     ~^~
      |     | |
      |     | int
      |     double
a.cc:12:2: error: expected '}' at end of input
   12 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

ll selfadd(ll a,ll b)
{
	if(a<b)
	return a;
	else return a%b;
}
void solve()
{

	ll n;
	
	cin>>n;
	
	
	if(n==1)
	cout<<1;
	
	
		if(n%2==0);
		cout<<0.5000000000;
		else
		cout<<0.6000000000;
		
		
	
	
	
	
	}
		
		


int main()
{


ios::sync_with_stdio(0); 
	cin.tie(0);
	
		solve();
	
return 0;

		
	}
	
	
	


Compiler output:
a.cc: In function 'void solve()':
a.cc:25:17: error: 'else' without a previous 'if'
   25 |                 else
      |                 ^~~~
Language: C++


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const ll INF = 1LL << 60;

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

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

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

int main(){
  
  double a;
  cin >> a;
  
  if( a%2 == 0 ){
    
    cout << 1/2 << endl;
    
  }
  
  else{
    
    cout << (a/2 + 1)/2 << 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( a%2 == 0 ){
      |       ~^~
      |       | |
      |       | int
      |       double
Language: C++

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


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

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

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

using namespace std;
using P = pair<int, int>; 
using ll = long long;


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

Compiler output:
a.cc:2:11: error: 'pair' does not name a type
    2 | using P = pair<int, int>;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     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 | using namespace std;
a.cc:9:9: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    9 |     if(n%2 == 0){
      |        ~^~
      |        | |
      |        | int
      |        double
a.cc:10:9: error: 'cout' was not declared in this scope
   10 |         cout<<0.5;
      |         ^~~~
a.cc:10:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:9: error: 'cout' was not declared in this scope
   12 |         cout<<(n+1)/(2*n);
      |         ^~~~
a.cc:12:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

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


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

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

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


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

#include <iostream>
 using namespace std;
 int main(){
 int N,K;
 cin>>N>>K;

 int cnt=0;
 for(int i=0;i<N;i++){
	 int h;
 cin>>h;
 if(h>=K) cnt++;
 }

cout<<cnt<<endl;
return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
  double a;
  double b = a - a/2;
  cout << b / a << else;
}


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

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
#define rep(i,n) for (ll i = 0; i < (ll)(n); ++i)
#define rrep(i,j,n) for(ll i = (ll)(j); i < (ll)(n); i++)
#define mrep(i,n) for (ll i = (ll)(n-1); i > 0; i--)
#define be(v) (v).begin(), (v).end()
#define scout cout << fixed << setprecision(20) 
ll INF = 1LL << 60;
ll mod = 1e9 + 7;

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

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

/******************************************************************************
 
рассвет. 
 
*******************************************************************************/
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define rapgame ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define eb emplace_back
#define vi vector <int>
#define vlli vector <lli>
#define vulli vector <ulli>
#define vchar vector <char>
#define vstr vector <string>
#define vb vector <bool>
#define fst first
#define sec second
#define srt(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define vpii vector <pair <int,int> >
#define pii pair <int,int> 
#define vplli vector <pair <lli,lli> >
#define vpulli vector <pair <ulli,ulli> >
#define vvi vector <vector <int> >
#define vvlli vector <vector <lli> >
#define vvpii vector <vector <pair <int,int>> >
#define fr(i,n) for (int i = 0; i < (n); ++i)
#define frbig(i,n) for (lli i = 0; i < (n); ++i)
#define fra(i,a,n) for (lli i = a; i < (n); ++i)
#define run(c,s) for(auto c:s) 
#define read(n) int n; cin >> n;
#define readchar(n) char n; cin >> n;
#define readstr(n) string n; cin >> n;
#define readarr(a,n) fr(i,n) cin >> a[i];
#define read2(x,y) int x,y; cin >> x >> y;
#define read2ll(x,y) long long int x,y; cin >> x >> y;
#define readll(n) lli n; cin >> n;
#define watch(x) cout << (#x) << " is " << (x) << endl
#define print_array(x) fr(i,x.size()) cout << x[i] << " ";
using namespace std;
 
const lli MOD=1e9+7;
const lli MAXN=1e6+1;
const ld PI=acos(-1);
 
int main(){
    rapgame
    double n;
    cin >> n;
    double ans=n/(n/2+(n%2>0));
    cout << fixed << setprecision(20) << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:25: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   53 |     double ans=n/(n/2+(n%2>0));
      |                        ~^~
      |                        | |
      |                        | int
      |                        double
Language: C++

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

void solve(long long N)
{
    long double n2;
    long long A;
    if (N % 2 == 0)
        cout << 0.5000000000 << endl;
    else if (N % 2 == 1 && N != 1)
    {
        A = N / 2 + 1;
        n2 = A / N;
        cout << / << endl;
    }
    else
        cout << 1.0000000000 << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    solve(N);
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int)':
a.cc:15:17: error: expected primary-expression before '/' token
   15 |         cout << / << endl;
      |                 ^
a.cc:15:19: error: expected primary-expression before '<<' token
   15 |         cout << / << endl;
      |                   ^~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    cout << fixed << setprecision(7);
    int n;
    cin >> n;
    if(n%2==0) cout << 0.5 << endl;
    double a=n;
    else cout << (a+1)/2*a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'else' without a previous 'if'
   14 |     else cout << (a+1)/2*a << endl;
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    cout << fixed << setprecision(7);
    double n;
    cin >> n;
    if(n%2==0) cout << 0.5 << endl;
    else cout << (n+1)/2*n << endl;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    cout << fixed << setprecision(7);
    double n;
    cin >> n;
    if(n%2==0) cout << 0.5 << endl;
    else cout << (n+1)/2n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   12 |     if(n%2==0) cout << 0.5 << endl;
      |        ~^~
      |        | |
      |        | int
      |        double
a.cc:13:24: error: unable to find numeric literal operator 'operator""n'
   13 |     else cout << (n+1)/2n << endl;
      |                        ^~
Language: C++

#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

using namespace std;

#define debug(x) cout<<(#x)<<"="<<(x)<<", ";
#define debug1(x) debug(x) cout<<'\n';
#define debug2(x1, x2) debug(x1) debug(x2) cout<<'\n';
#define debug3(x1, x2, x3) debug(x1) debug(x2) debug(x3) cout<<'\n';
#define debug4(x1, x2, x3, x4) debug(x1) debug(x2) debug(x3) debug(x4) cout<<'\n';
#define debug5(x1, x2, x3, x4, x5) debug(x1) debug(x2) debug(x3) debug(x4) debug(x5) cout<<'\n';

#define fcout cout<<fixed<<setprecision(15)
#define repp(i,j,k) for(int i=j; i<k; ++i)
#define rep(i,j) repp(i,0,j)
#define rrep(i,j,k) for(int i=j; i>=k; --i)
#define all(x) (x).begin(), (x).end()
#define sort(x) sort(x.begin(), x.end())
#define lb(x,val) lower_bound(x.begin(), x.end(), val)
#define ub(x,val) upper_bound(x.begin(), x.end(), val)
#define pb(x) emplace_back(x);

typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
typedef vector<int> vi;
typedef vector<lli> vl;
typedef tuple<int, int, lli> tiil;

//const lli M=998244353ll;
const lli M=1000000007ll;
const double D=1.0;

int main(){
	fast_io 
	int n; cin>>n;
	int k=0
	repp(i,1,n+1){
		if(i&1) k++;
	}
	cout<<(k*D/n);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:21: error: expected ',' or ';' before 'for'
   23 | #define repp(i,j,k) for(int i=j; i<k; ++i)
      |                     ^~~
a.cc:47:9: note: in expansion of macro 'repp'
   47 |         repp(i,1,n+1){
      |         ^~~~
a.cc:47:14: error: 'i' was not declared in this scope
   47 |         repp(i,1,n+1){
      |              ^
a.cc:23:34: note: in definition of macro 'repp'
   23 | #define repp(i,j,k) for(int i=j; i<k; ++i)
      |                                  ^
Language: Java

import java.util.Scanner;

public class one {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);

		//入力表示
		int N = scanner.nextInt();
		int B = 0;

		if (N % 2 == 0) {
			B = N / 2;
		
		} else {
			B = N / 2 + 1;
		}

	 System.out.println((double)B/N); 
    }
}

Compiler output:
Main.java:3: error: class one is public, should be declared in a file named one.java
public class one {
       ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scanner = new Scanner(System.in);

		//入力表示
		int N = scanner.nextInt();
		int B = 0;

		if (N % 2 == 0) {
			B = N / 2;
	
		} else {
			B = N / 2 + 1;
		}


    }
}
	 System.out.println((double)B/N); 

Compiler output:
Main.java:24: error: class, interface, enum, or record expected
	 System.out.println((double)B/N); 
	 ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N; cin>>N;
  if(N%2==0)
    cout<<0.50000000000<<endl;
  else
    int K=(N+1)/2;
    cout<<fixed<<setprecision(12);
    cout<<K/(double)N<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'K' was not declared in this scope
   10 |     cout<<K/(double)N<<endl;
      |           ^
Language: C++

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

int main() {
  double N;
  cin >> N;
  if (N % 2.0 == 0.0) cout << 0.5000000000 << endl;
  else {
    double ans = (N/2 + 1)/N;
    cout << fixed << setprecision(10);
    cout << ans << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: invalid operands of types 'double' and 'double' to binary 'operator%'
    8 |   if (N % 2.0 == 0.0) cout << 0.5000000000 << endl;
      |       ~ ^ ~~~
      |       |   |
      |       |   double
      |       double
Language: C++

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

int main() {
  double N;
  cin >> N;
  if (N % 2 == 0.0) cout << 0.5000000000 << endl;
  else {
    double ans = (N/2 + 1)/N;
    cout << fixed << setprecision(10);
    cout << ans << endl;
  }
}


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

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

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


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

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

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

   if (n % 2 == 0) cout << n / 2 << endl;
   else if(n % 2 != 0) cout << (n / 2 + 1) / n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   11 |    if (n % 2 == 0) cout << n / 2 << endl;
      |        ~ ^ ~
      |        |   |
      |        |   int
      |        double
a.cc:12:14: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   12 |    else if(n % 2 != 0) cout << (n / 2 + 1) / n << endl;
      |            ~ ^ ~
      |            |   |
      |            |   int
      |            double
Language: C++

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

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

#include<iostream>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

void solve() {
	int n;
	cin >> n;
	
	if(n%2 == 0) {
		double val = n;
		double res = (val/2)/val;
		cout << setprecision(10) << res << endl;
	} else {
		double val = n;
		double res = ((val/2)+1)/val;
		cout << setprecision(10) << res << endl;
	}
}
		
			
		

int32_t main() {
	IOS;
	solve();
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:15:25: error: 'setprecision' was not declared in this scope
   15 |                 cout << setprecision(10) << res << endl;
      |                         ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include<iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
a.cc:19:25: error: 'setprecision' was not declared in this scope
   19 |                 cout << setprecision(10) << res << endl;
      |                         ^~~~~~~~~~~~
a.cc:19:25: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
Language: C++

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

int main() {

	int n;
	cin >> n;
  
  	int odd = (n+1)/2;
  	double ans = (double)add/n;
  	printf("%.10f\n",ans);
 	return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'?
   10 |         double ans = (double)add/n;
      |                              ^~~
      |                              std::filesystem::perm_options::add
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:219:7: note: 'std::filesystem::perm_options::add' declared here
  219 |       add       = 0x2,
      |       ^~~
Language: C++

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

signed main () {
  int n;
  cin >> n;
  cout << fixed << setprecision(15) << (1.0 * (n - (n / 2)) / (1.0 * n) << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:73: error: invalid operands of types 'double' and 'char' to binary 'operator<<'
    7 |   cout << fixed << setprecision(15) << (1.0 * (n - (n / 2)) / (1.0 * n) << '\n';
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~
      |                                                             |              |
      |                                                             double         char
a.cc:7:80: error: expected ')' before ';' token
    7 |   cout << fixed << setprecision(15) << (1.0 * (n - (n / 2)) / (1.0 * n) << '\n';
      |                                        ~                                       ^
      |                                                                                )
Language: C++

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

signed main () {
  double n;
  cin >> n;
  cout << fixed << setprecision(30) << (n / 2.0 + double(int(n % 2))) / n << '\n';
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:64: error: invalid operands of types 'double' and 'int' to binary 'operator%'
    7 |   cout << fixed << setprecision(30) << (n / 2.0 + double(int(n % 2))) / n << '\n';
      |                                                              ~ ^ ~
      |                                                              |   |
      |                                                              |   int
      |                                                              double
Language: C++

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

signed main () {
  double n;
  cin >> n;
  cout << fixed << setprecision(30) << (n / 2.0 + n % 2.0) / n << '\n';
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:7:53: error: invalid operands of types 'double' and 'double' to binary 'operator%'
    7 |   cout << fixed << setprecision(30) << (n / 2.0 + n % 2.0) / n << '\n';
      |                                                   ~ ^ ~~~
      |                                                   |   |
      |                                                   |   double
      |                                                   double
Language: C++

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

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)

#define ALL(v) v.begin(), v.end()

int main() {
  std::cout << std::fixed << std::setprecision(20);
  int64_t N;
  cin >> N;
  int64_t n = N + 1 / 2.0;
  double ans = (double)n / (double)N
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected ',' or ';' before 'cout'
   16 |   cout << ans << endl;
      |   ^~~~
Language: C

int main()
{
  int n;
  scanf("%d", n);
  double ans;
  int i, cnt = 0;
  for (i = 1; i <= n; i++)
  {
    if (i % 2 != 0)
      cnt++
  }
  ans = cnt / n;
  printf("%ld", ans);
}

Compiler output:
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |   scanf("%d", n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main()
main.c:4:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |   scanf("%d", n);
      |   ^~~~~
main.c:4:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:10:12: error: expected ';' before '}' token
   10 |       cnt++
      |            ^
      |            ;
   11 |   }
      |   ~         
main.c:13:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   13 |   printf("%ld", ans);
      |   ^~~~~~
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:13:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:13:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
using namespace std;
int main(){
  float a;
  cin >> a;
  cout << (float(a/2)+float(a%2))/a << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:30: error: invalid operands of types 'float' and 'int' to binary 'operator%'
    6 |   cout << (float(a/2)+float(a%2))/a << endl;
      |                             ~^~
      |                             | |
      |                             | int
      |                             float
Language: C++

#include <iostream>
using namespace std;
int main(){
  float a;
  cin >> a;
  cout << float(a/2+a%2)/float(a) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: invalid operands of types 'float' and 'int' to binary 'operator%'
    6 |   cout << float(a/2+a%2)/float(a) << endl;
      |                     ~^~
      |                     | |
      |                     | int
      |                     float
Language: C++

#include <iostream>
using namespace std;
int main(){
  float a;
  cin >> a;
  cout << float(a/2+a%2)/a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: invalid operands of types 'float' and 'int' to binary 'operator%'
    6 |   cout << float(a/2+a%2)/a << endl;
      |                     ~^~
      |                     | |
      |                     | int
      |                     float
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
double N;
cin>>N;
cout<< fixed << setprecision(10);
if(N%2==0){
cout<<N/(N/2)<<setprecision(10)<<endl;
}
else
cout<<((N-1)/2)/N<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: 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;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

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

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

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


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(A%2==0)
      |      ~^~
      |      | |
      |      | int
      |      double
Language: C++

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

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(A%2=0)
      |      ~^~
      |      | |
      |      | int
      |      double
a.cc:9:3: error: 'K' was not declared in this scope
    9 |   K=(A+1)/(2*A);
      |   ^
Language: C++

#include <bits/stdc++.h>
    using namespace std;
    int main(){
        int N;
        cin >> N;

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

        if(N%2==0){
        cout << 0.5 << endl;
        }else{
        cout<<(double) (N + 1) / (2 * N) << endl;
        }
    }

Compiler output:
a.cc:12:6: error: stray '#' in program
   12 |     }#include <bits/stdc++.h>
      |      ^
a.cc:12:7: error: 'include' does not name a type
   12 |     }#include <bits/stdc++.h>
      |       ^~~~~~~
a.cc:14:9: error: redefinition of 'int main()'
   14 |     int main(){
      |         ^~~~
a.cc:3:9: note: 'int main()' previously defined here
    3 |     int main(){
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
    using namespace std;
    int main(){
        int N;
        cin >> N;

        if(N%2==0){
        cout << 0.5 << endl;
        }else{
        cout<<fixed<<setprecion(5) << (N + 1) / (2 * N) << endl;
        }
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'setprecion' was not declared in this scope; did you mean 'setreuid'?
   10 |         cout<<fixed<<setprecion(5) << (N + 1) / (2 * N) << endl;
      |                      ^~~~~~~~~~
      |                      setreuid