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

#include <stdio.h>

int main(void) {
  int i,N,sum = 0;
  
  pritnf("enter the number.¥n");
  scanf("%d",&N);

  for(i=1;i<=N;i++) {
    if((i%3) != 0 || (i%5) != 0)
      sum += i;
  }
  
  printf("%d",sum);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
    6 |   pritnf("enter the number.¥n");
      |   ^~~~~~
      |   printf
Language: C

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

    vector<int> vec(N);
    for(int i=0; i<N; i++){
        vec.at(i) = i + 1;
    }

    long long int sum = 0;

    for(int i=0; i<N; i++){
        if(vec.at(i) % 3 == 0 || vec.at(i) % 5 == 0){
            vec.at(i) = 0;
        }
        sum += vec.at(i);
    }

    cout << sum << endl;
}


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

#include<bits/stdc++.h> //ABC 162_b
#define ll long long
using namespace std;
int main(){
	int n;
	cin>>n;
	ll ans=0;
	for(int i=1;i<=n;i++){
		if(i%3==0||i%5==0)
			continue;
		ans+=i;
	}
	cout<<ans;
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h> //ABC 162_b
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(int argc, char const *argv[])
{
	int n;
	scanf("%d",&n);
	for(register int i = 1;i <= n;i++)
		if(i % 3 != 0 && i % 5 != 0)
			ans += i;
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:8:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |         for(register int i = 1;i <= n;i++)
      |                          ^
a.cc:10:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |                         ans += i;
      |                         ^~~
      |                         abs
a.cc:11:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |         printf("%lld\n",ans);
      |                         ^~~
      |                         abs
Language: C++

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

int main(){
    int n;
    cin >> n;
    int allsum = 0;
    int n3 = n / 3;
    int n5 = n / 5;
    int n15 = n / 15;
    int i = 0;
    int j = 0;
    int k = 0;
    int l = 0;
    while (i < n){
        allsum = allsum + i;
        i = i + 1;
    }
    while (j < n3){
        all3sum = all3sum + j;
        j = j + 1;
    }
    while (k < n5){
        all5sum = all5sum + k;
        k = k + 1;
    }
    while (l < n15){
        all15sum = all15sum + l;
        l = l + 1;
    }
    cout << allsum - all3sum -all5sum + all15sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'all3sum' was not declared in this scope; did you mean 'allsum'?
   20 |         all3sum = all3sum + j;
      |         ^~~~~~~
      |         allsum
a.cc:24:9: error: 'all5sum' was not declared in this scope; did you mean 'allsum'?
   24 |         all5sum = all5sum + k;
      |         ^~~~~~~
      |         allsum
a.cc:28:9: error: 'all15sum' was not declared in this scope; did you mean 'allsum'?
   28 |         all15sum = all15sum + l;
      |         ^~~~~~~~
      |         allsum
a.cc:31:22: error: 'all3sum' was not declared in this scope; did you mean 'allsum'?
   31 |     cout << allsum - all3sum -all5sum + all15sum << endl;
      |                      ^~~~~~~
      |                      allsum
a.cc:31:31: error: 'all5sum' was not declared in this scope; did you mean 'allsum'?
   31 |     cout << allsum - all3sum -all5sum + all15sum << endl;
      |                               ^~~~~~~
      |                               allsum
a.cc:31:41: error: 'all15sum' was not declared in this scope; did you mean 'allsum'?
   31 |     cout << allsum - all3sum -all5sum + all15sum << endl;
      |                                         ^~~~~~~~
      |                                         allsum
Language: C

#include<bits/stdc++.h>
using namespace std;
long long sum(long long n){return n*(n+1)/2;}
 int main(){
int n;
 scanf("%d",&n);
 long long ans;
 ans=sum(n)-sum(n/3)*3-sum(n/5)*5+sum(n/15)*15;
 printf("%lld\n",ans);
 }

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

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

int main() {
  int N,s=0;
  cin>>N;
  	for(i=1;i<=N;i++) {
    if(i/3!=0&&N/5!=0) s+=i;
    }
  cout<<s<<endl;
}


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

#include <bits/stdc++.h>
using namespace std;
int main(){
  long N;
  cin >> N;
  long long sum = 0;
  for(long i = 1; i < N+1; i++){
    if(i%3 != 0 && i%5 != 0){
      sum = sum+i;
    }
  }
  cout << sum << endl;
}


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

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

int main() {
  int N;
  cin >> N;
  int64_t a = 0;
  for (int i = 1; i <= N; i++) {
    if (i % 3 == 0 || i % 5 == 0) {
      continue;
    }
    else {
    a += i;
    }
  }
    cout << a << endl;
}


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

/*dismint|jjc*/
#include <bits/stdc++.h>
using namespace std;

#define io(F) string t_="";ifstream fin(t_+F+".in");ofstreamfout(t_+F+".out")
#define qio ios_base::sync_with_stdio(false); cin.tie(NULL)
#define forl(V, S, E) for(int V = S; V < E; V++)
#define ford(V, S, E) for(int V = S; V >= E; V--)
#define fore(E, X) for(auto &E:X)
#define println(X) cout << X << endl
#define printe(X) for(auto &E:X) cout << E << " "; cout << endl
#define graph unordered_map<int, unordered_set<int>>
typedef long long ll;

int main() {
	qio; int n; cin >> n;
	ll sum = 0;
	forl(i, 1, n+1) {
		if(!(i%3) or !(i%5)) continue;
		sm += i;
	}
	println(sm);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'sm' was not declared in this scope; did you mean 'sum'?
   20 |                 sm += i;
      |                 ^~
      |                 sum
a.cc:22:17: error: 'sm' was not declared in this scope; did you mean 'sum'?
   22 |         println(sm);
      |                 ^~
a.cc:10:28: note: in definition of macro 'println'
   10 | #define println(X) cout << X << endl
      |                            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,n) for(ll i=0;i<n;i++)
#define fa(i,a,b) for(ll i=a;i<=b;i++)
#define fr(i,n) for(ll i=n-1;i>=0;i--)
#define endl "\n"
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ms(array,value) memset(array,value,sizeof(array))
#define test(t) ll t;cin>>t;while(t--)
#define en cout<<endl;
#define mod 1000000007
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vector<int> >
#define pb push_back
#define all(a) a.begin(),a.end()
#define pi pair<int,int>
#define mod2  998,244,353

int main()
{
    int n; cin>>n;
    fa(i,1,n)
    {

}


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

#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
	void solve() {
		int n;
		cin >> n;
		long long ans = 0;
		for (int i = 1; i <= n; i++) {
			if (i % 3 == 0) continue;
			if (i % 5 == 0) continue;
			ans += i;
		}
		cout << ans << "\n";

		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
 
#define ff              first
#define ss              second
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define lld 			long long 
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());


void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int main()
{
  c_p_c();
  lld n;
  cin >> n;
  lld sum =((n*(n+1))>>1);
  lld p = floor(n/3);
  lld q = floor(n/5);
  lld r = floor(n/15);
  lld a = ((p*(p+1))/2)*3 + ((q*(q+1))/2)*5 - ((r*(r+1))/2)*15;
  cout<<sum - a<<endl;
  return 0; 
}


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

#include <stdio.h>
#include <stdlib.h>

using namespace std;

int main()
{
    int N,
    long long sum=0;
    scanf("%d",&N);
    for(int i=1;i<=N;i++){
        if(i%3!=0&&i%5!=0){
            sum+=i;
        }
    }
    printf("%lld\n",sum);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected unqualified-id before 'long'
    9 |     long long sum=0;
      |     ^~~~
a.cc:13:13: error: 'sum' was not declared in this scope
   13 |             sum+=i;
      |             ^~~
a.cc:16:21: error: 'sum' was not declared in this scope
   16 |     printf("%lld\n",sum);
      |                     ^~~
Language: C

#include<bits/stdc++.h>
using namespace std;
int n;
long long sum;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        if(i%3==0||i%5==0)continue;
        else sum+=i;
    }
    cout<<sum<<endl;
    return 0;
}


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

//int a = stoi(c); 文字列をintへ
//小文字から大文字
//transform(a.begin(), a.end(), a.begin(), ::toupper);
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//while(N)で回すとき、Nはコピーを作っておく
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//等価なものに変換する思考
//bool型　初期値はTrue
//島渡りの問題：中間ノードに着目
//配列はvector<>を使う：意味わからないエラーがなくなる。
//背反な事象にちゃんとわける
//チェックリストはマップを使う
//数が大きい時の比較はstring型で行う
//全て0になったか調べたい->0になるたびにcntする
//またはかかつか
//例外処理は最初にする
//x = p^m + q^n...の約数の個数:(n+1)*(m+1)....
//N!のどの素因数で何回割れるか
//⇔1~Nまでの数がそれぞれどの素因数で何回割り切れるかの和
//パズルの問題->一般化して全探索
//数が大きい時のせぐふぉはコードテストで試してみる
//スペルミスに注意
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
	using namespace std;

//円周率
const double PI = 3.14159265358979323846;
//割るやつ
const ll M = (pow(10, 9) + 7);

// K進数でのNの桁数
ll dig(ll N, ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
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;
}

//nC2の計算
ll C(ll N) {
	return N * (N - 1) / 2;
}

//階乗計算
ll f(ll n) {
	if (n == 0 || n == 1) return 1;
	else return (n * f(n - 1)) % M;
}

//Nをdで何回割れるか
ll divcnt(ll N, ll d) {
	ll ans = 0;
	while (1) {
		if (N%d == 0) {
			ans++;
			N /= d;
		}
		else break;
	}

	return ans;
}

//素数判定
bool prime(ll num) {
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2) {
		if (num % i == 0) return false;
	}
	return true;
}

//フィボナッチ数列
vector<ll> memo(pow(10, 6) + 1);
ll fibo(ll n) {
	if (n == 1) return 1;
	else if (n == 2) return 1;
	else if (memo[n] != 0) return memo[n];
	else return memo[n] = fibo(n - 1) + f(n - 2);
}

int main() {
	ll N; cin >> N;
	ll ans = 0;
	for (int i = 1; i <= N; i++) {
		if (i % 3 != 0 && i % 5 != 0)ans += i;
	}

	cout << ans << endl;
}

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

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <climits>
#include <numeric>
#include<stdio.h>
#include <queue>
#include <iomanip>
#include <float.h>
#include <set>
#include<functional>
#include <stack>
#include <time.h>
#include <climits>
#include <bitset>
#include <fstream>
#include<map>
#include <cassert>
#include<sstream>
#include<fstream>
#include <cstring>
using namespace std;
typedef pair<int, string>p;
map< int64_t, int > prime_factor(int64_t n) {
	map< int64_t, int > ret;
	for (int64_t i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}
const int MAX =1;
const int MOD = 998244353;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	long long ans = 0;
	for (int i = 0; i <= n; i++) {
		if ((i % 3) != 0 && (i % 5) != 0)ans += i;
	}
	cout << ans;
}



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

#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<map>
#include<ctime>

using namespace std;

template <typename T>

inline T read()
{
	T x=0,f=1;char c=getchar();
	while(!isdigit(c))
	{if(c=='-') f=-f;c=getchar();}
	while(isdigit(c))
	{x=(x<<3)+(x<<1)+(c-48);c=getchar();}
	return x*f;
}

#define lint long long int
#define ulint unsigned lint

const int inf=1e9+1e7;

int main(void)
{

	// freopen("testdata.in","r",stdin);
	// freopen("testdata.out","w",stdout);

	lint n=read<lint>();

	lint ans=n*(n+1)/2;
	lint tmp=n/3;
	lint res=tmp*(tmp+1)/2;

	ans-=(res*3);
	tmp=n/5;
	res=tmp*(tmp+1)/2;
	ans-=(res*5);
	tmp=n/15;
	res=tmp*(tmp+1)/2;
	ans+=(res*15);

	printf("%lld\n",ans);

	return 0;

}

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

#include <bits/stdc++.h>
using namespace std;
#define pb                push_back
#define int               long long
#define M                 1000000007
#define MM                998244353
#define fr                first
#define sc                second
#define vc                vector
#define pii               pair<int,int>
#define msi               map<string,int>
#define mii               map<int,int>
#define psi               pair<string,int>
#define pis               pair<int,string>
#define piii              pair<int,pii>

	signed main() {
	
		   int t=1;
		  //cin>>t;
		   while(t--)
		   {
		   		
		   	int n,k,w,mx=0,sum=0,xx=0;
		             string s;

		        cin>>n;
	int a[n],ii[n],b[n],c[n],p[n],q[n];
   for(int i=1;i<=n;i++)
   if(i%3!=0&&i%5!=0)sum+=i;
cout<<i<<endl;
}
 
	} 

Compiler output:
a.cc: In function 'int main()':
a.cc:31:7: error: 'i' was not declared in this scope
   31 | cout<<i<<endl;
      |       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define pb                push_back
#define int               long long
#define M                 1000000007
#define MM                998244353
#define fr                first
#define sc                second
#define vc                vector
#define pii               pair<int,int>
#define msi               map<string,int>
#define mii               map<int,int>
#define psi               pair<string,int>
#define pis               pair<int,string>
#define piii              pair<int,pii>

	signed main() {
	
		   int t=1;
		  //cin>>t;
		   while(t--)
		   {
		   		
		   	int n,k,w,mx=0,sum=0,xx=0;
		             string s;

		        cin>>s;
	int a[n],ii[n],b[n],c[n],p[n],q[n];
   for(int i=1;i<=n;i++)
   if(i%3!=0&&i%5!=0)sum+=i;
cout<<i<<endl;
}
 
	} 

Compiler output:
a.cc: In function 'int main()':
a.cc:31:7: error: 'i' was not declared in this scope
   31 | cout<<i<<endl;
      |       ^
Language: Java

import java.util.*;
 
class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int sum = 0;
    for(int i = 1; i <= N; i++) {
      if(i % 3 == 0 || i % 5 == 0) {
        continue;
      } else {
        sum += i;
      }
    }
    
    System.out.println(sum);
  }
}

Compiler output:
Main.java:7: error: cannot find symbol
    for(int i = 1; i <= N; i++) {
                        ^
  symbol:   variable N
  location: class Main
1 error
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
//typedef __int64 LL;
typedef vector<int> ivec;
typedef vector<string> svec;

//int a[100010];
int main(){
	int n=0;
	LL ans=0;
	cin>>n;
	for(int i=1;i<=n;i++){
	    if(i%3!=0 && i%5!=0)ans+=i;
	}
	cout<<ans<<endl;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'LL' was not declared in this scope
   20 |         LL ans=0;
      |         ^~
a.cc:23:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |             if(i%3!=0 && i%5!=0)ans+=i;
      |                                 ^~~
      |                                 abs
a.cc:25:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: Java

package beginnerContest162;

import java.util.Scanner;

public class B_FizzBuzzSum {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		long sum = 0;
		for(int i = 1 ; i <= n ; i++) {
			if(i % 3 != 0 && i % 5 != 0) {
				sum += i;
			}
		}
		System.out.println(sum);
		scan.close();
	}

}


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

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

int main(){
    int N;
    cin >> N;
    long long sum = ((1 + N) * N / 2) - 3 * ((1 + (N/3)) * N/3 / 2) - 5 * ((1 + (N/5)) * N/5 / 2) + 15 * ((1 + (N/15)) * N/15 / 2);

    cout << sum << endl;
    
}

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

#include <iostream>
using namespace std;
using ll = long long

int main()
{
	int n;
	cin >> n;
	ll a = 0;
	for (int i = 1; i <= n; ++i)
	{
		if (!(i%3 == 0 || i%5 == 0))
		{
			a = a + i;
		}
	}
	cout << a;
}

Compiler output:
a.cc:5:4: error: expected ';' before 'main'
    5 | int main()
      |    ^~~~~
      |    ;
Language: C


// Problem : B - FizzBuzz Sum
// Contest : AtCoder - AtCoder Beginner Contest 162
// URL : https://atcoder.jp/contests/abc162/tasks/abc162_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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


int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);

    long n;
    cin >> n;
    long long s = 0;
    for (long i = 1; i <= n; i++) {
        if (i % 3 != 0 && i % 5 != 0) s = s + i;
    }
    cout << s;
    
    return 0;
}


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

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <string>
#include <map>
#include <iterator>


using namespace std;


int main() {

    int N;
    cin >> N;

    long sum = 0;
    for (int i = 0; i <= N; ++i) {
        if (i % 3 == 0 and i % 5 == 0) {

        } else if (i % 3 == 0) {

        } else if (i % 5 == 0) {

        } else {
            sum += i;
        }
    }

    cout << sum << 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 <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <iterator>


using namespace std;


int main() {

    int N;
    cin >> N;

    long sum = 0;
    for (int i = 0; i <= N; ++i) {
        if (i % 3 == 0 and i % 5 == 0) {

        } else if (i % 3 == 0) {

        } else if (i % 5 == 0) {

        } else {
            sum += i;
        }
    }

    cout << sum << 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 <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <iterator>
#include <iostream>
#include <sstream>
#include <iterator>
#include <numeric>

using namespace std;


int main() {

    int N;
    cin >> N;

    long sum = 0;
    for (int i = 0; i <= N; ++i) {
        if (i % 3 == 0 and i % 5 == 0) {

        } else if (i % 3 == 0) {

        } else if (i % 5 == 0) {

        } else {
            sum += i;
        }
    }

    cout << sum << 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() {
  int N;
  cin >> N;
  
  int sum;
  
  for(int i = 1; i <= N; i++){
    if( i % 3 == 0){
      continue;
    }
    else if( i % 5 == 0){
      continue;
    }
    else { sum += i; }
  }
  cout << sum << endl;
}
  
  

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

#include <bits/stdc++.h>

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n;
  std::cin >> n;

  int64_t sum = 0;

  for (int64_t i = 1; i <= n; i++) {
    if (i % 3 != 0 && i % 5 != 0) {
      sum += i;
    }
  }
  std::cout << sum << std::endl;
  return 0;
}

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

#include <iostream>
using namespace std;
typedef long long int ll;
int main()
{
    ll n;
    cin>>n;
    ll suxx=n*(n+1)/2;
    ll m3=n/3;
    ll m5=n/5;
    ll m15=n/15;
    ll s3= m3*(2*3 +(m3 -1)*3)/2;
    ll s5= m5*(2*5 +(m5 -1)*5)/2;
    ll s15= m15*(2*15 +(m15 -1)*15)/2;
    ll sux=s3+s5-s15;


Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: expected '}' at end of input
   15 |     ll sux=s3+s5-s15;
      |                      ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C

#include <iostream>
using namespace std;
typedef long long int ll;
int main()
{
    ll n;
    cin>>n;
    ll suxx=n*(n+1)/2;
    ll m3=n/3;
    ll m5=n/5;
    ll m15=n/15;
    ll s3= m3*(2*3 +(m3 -1)*3)/2;
    ll s5= m5*(2*5 +(m5 -1)*5)/2;
    ll s15= m15*(2*15 +(m15 -1)*15)/2;
    ll sux=s3+s5-s15;
    cout<<suxx-sux;
    return 0;
}

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

#include<iostream>
using namespace std;
typedef long long int ll;
int main()
{
    ll n;
    cin>>n;
    ll suxx=n*(n+1)/2;
    ll m3=n/3;
    ll m5=n/5;
    ll m15=n/15;
    ll s3= m3*(2*3 +(m3 -1)*3)/2;
    ll s5= m5*(2*5 +(m5 -1)*5)/2;
    ll s15= m15*(2*15 +(m15 -1)*15)/2;
    ll sux=s3+s5-s15;
    cout<<suxx-sux;
    return 0;
}

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

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

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,sum=0;
	cin>>n;
	for(int i=1;i<n;i++){
		if(i%3!=0 && i%5!=0){
			sum+=i;
		}
	}
	cout<<sum<<endl;
}


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

#include <string>
#include <iostream>
using namespace std;
 
int main(){
  int N;
  ll sum=0;
  cin >> N;
  for (int i =1; i< N+1; i++){
    if (i%3 !=0 && i%5 !=0){
        sum +=i;
    }
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
    7 |   ll sum=0;
      |   ^~
a.cc:11:9: error: 'sum' was not declared in this scope
   11 |         sum +=i;
      |         ^~~
a.cc:14:11: error: 'sum' was not declared in this scope
   14 |   cout << sum << endl;
      |           ^~~
Language: C

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

typedef long long ll;

int main(){
    int n;
    ll sum = 0;
    cin>>n;
    for(int i=1;i<=n;i++){
        if(i%3!=0 && i%5!=0) sum += i;
    }
    cout << sum << endl;
}

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

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // write your code here

        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int N = in.nextInt();
        
        long ans = 0;

        for (int i = 1; i <= N; i++) {
           if(i % 5 != 0 && i % 3 != 0) ans+= i; 
        }
        
        out.println(ans);
        out.close();
        
        
    }
}


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import java.io.PrintWriter;
      | ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    1 | import java.io.PrintWriter;
      |            ^
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.Scanner;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.Scanner;
      |            ^
main.c:4:1: error: unknown type name 'public'
    4 | public class Main {
      | ^~~~~~
main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main'
    4 | public class Main {
      |              ^~~~
Language: C

/*
!لَا أَبْرَحُ حَتَّىٰ أَبْلُغَ
فَصَبْرٌ جَمِيلٌ
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define endl                         '\n'	
#define Ceil(x,y)             ((x+y-1)/y)
#define sz(s)               (int)s.size()
#define RT(x)           return cout<<x,0;
#define mem(x,y)    memset(x,y,sizeof(x))
#define all(v) ((v).begin()), ((v).end())
#define vi                    vector<int>
#define Tesla              file();
#define fr(x,y) for(int x=0; x<(y); ++x)
const double PI = acos(-1), EPS = 1e-7;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int dr[] { -1, -1, 0, 1, 1, 1, 0, -1 };
const int dc[] { 0, 1, 1, 1, 0, -1, -1, -1 };
ll gcd(ll x, ll y) { return (!y) ? x : gcd(y, x%y); }
ll lcm(ll x, ll y) { return ((x / gcd(x, y))*y); }
ll mod = 998244353;
ll power(ll x, ll y)
{
	if (y == 0)return 1;
	if (y == 1)return x;
	ll r = power(x, y / 2) % mod;
	return r%mod*r%mod*power(x, y % 2) % mod;
}
void file() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

}

int main()
{
	Tesla
		int n; cin >> n;
	ll ans = 0;
	fr(i, n + 1)
	{
		if (i % 3 == 0 || i % 5 == 0)
			continue;
		ans += i;
	}
	cout << ans;
}

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

#include <bits/stdc++.h>
using namespace std;
  
  int main() {
  long long N;
  cin >> N;
  vector <long long>vec(N);
  long long ans = 0;
  for(long long i = 0; i < N; i++){
    if((i+1) % 5 != 0 && (i+1) % 3 != 0){
      vec.at(i) = i+1;
      ans += vec.at(i);
    }
    else{
      ans +=0;
    }
  }
  cout << ans << endl;

  }
  

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

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

int main() {
  int N;
  cin >> N;
  vector <int>vec(N);
  int ans =0;
  for(int i = 0; i < N; i++){
    if((i+1) % 5 != 0 &&(i+1) % 3 != 0){
      vec.at(i) = i+1;
      ans += vec.at(i);
    }
  }
  cout << ans << endl;

  }
  

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

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

// Begin Template IO/Utility
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
void dbg_out(){
	cerr<<endl;
}
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T){
	cerr<<' '<< H;
	dbg_out(T...);
}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &V){
	os<<'[';
	for(int i=0;i<(int)V.size();i++)
		os<<V[i]<<",]"[i==(int)V.size()-1];
	return os;
}
template<typename T> istream& operator>>(istream &is, vector<T> &V){
	for(T &x:V)
		is>>x;
	return is;
}
template<typename T, typename U> ostream& operator<<(ostream &os, const pair<T,U> &p){
	os<<'{'<<p.first<<','<<p.second<<'}';
	return os;
}
template<typename T, typename U> istream& operator>>(istream &is, pair<T,U> &p){
	is>>p.first>>p.second;
	return is;
}
template<typename T> void minself(T &a, T b){
	a=min(a,b);
}
template<typename T> void maxself(T &a, T b){
	a=max(a,b);
}
// End Template IO/Utility

int main(){
	int N;
	long long res=0L;
	cin>>N;
	for(int i=1;i<=N;i++)
		if(i%3 && i%5)
			res+=i;
	cout<<res;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{  int n;
 cin>>n;
 long long sum=0;
 for(int i=0;i<=n;i++)
 {if(i%3!=0&&i%5!=0)
   sum+=i;
 }cout<<sum;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{  int n;
 cin>>n;
 long long sum=0;
 for(int i=0;i<n;i++)
 {if(i%3!=0&&i%5!=0)
   sum+=i;
 }cout<<sum;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{  int n;
 cin>>n;
 long long sum;
 for(int i=0;i<n;i++)
 {if(i%3!=0&&i%5!=0)
   sum+=i;
 }cout<<sum;
}

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

#include<iostream>
using namespace std;
int main()
{
int N;
  int Fizz=0,Buzz=0,Common=0,f=0,b=0,c=0,ans=0;
  cin>>N;
  Fizz = N/3;
  Buzz = N/5;
  Common = N/15;
  f = (3+Fizz*3)*Fizz/2);
  b = (5+Buzz*5)*Buzz/2);
  c = (15+Common*15)*Common/2;
  ans = (1+N)*N/2 -f -b+c;
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before ')' token
   11 |   f = (3+Fizz*3)*Fizz/2);
      |                        ^
      |                        ;
a.cc:12:24: error: expected ';' before ')' token
   12 |   b = (5+Buzz*5)*Buzz/2);
      |                        ^
      |                        ;
Language: C++

#include<iostream>
using namespace std;
int main()
{
int N;
  int Fizz=0,Buzz=0,Common=0,f=0,b=0,c=0,ans=0;
  cin>>N;
  Fizz = N/3;
  Buzz = N/5;
  Common = N/15;
  f = Fizz>0?(3+Fizz*3)*Fizz/2:0;
  b = Buzz>0?(5+Buzz*5)*Buzz/2:0;
  c = Common>0?(15+Common*15)*Comon/2:0;
  ans = (1+N)*N/2 -f -b+c;
  cout<<ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: 'Comon' was not declared in this scope; did you mean 'Common'?
   13 |   c = Common>0?(15+Common*15)*Comon/2:0;
      |                               ^~~~~
      |                               Common
Language: C++

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

int main() {
  int64_t N;
  cin >> N;
  int64_t X = 0;
  
  for(int64_t i = 1; i =< N; i++ ){
    if(i%3 != 0 && i%5 != 0) {
   X += i;
  }
  }
  cout << X << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected primary-expression before '<' token
    9 |   for(int64_t i = 1; i =< N; i++ ){
      |                         ^
Language: C++

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

int main() {
  int64_t N;
  cin >> N;
  int64_t X = 0;
  
  for(int64_t i = 0; i < N; i++ ){
    if(i%3 == 0 && i%5 == 0) 
    else {
      X += i;
  }
  cout << X << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected primary-expression before 'else'
   11 |     else {
      |     ^~~~
Language: C++

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

int main() {
  int64_t N;
  cin >> N;
  int64_t X = 0;
  
  for(int64_t i = 0; i < N; i++ ){
    if(i%3 == 0 && i%5 == 0) 
    else {
      X += i;
  }
  cout << X << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected primary-expression before 'else'
   11 |     else {
      |     ^~~~
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
  int64_t N;
  cin >> N;
  int64_t X = 0;
  
  for(int64_t i = 0; i < N; i++ ){
    if(i%3 != 0 && i%5 != 0) {
     int X + i;
    }
  }
  cout << X << endl;
}

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

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

int main() {
  int64_t N;
  cin >> N;
  int64_t X = 0;
  
  for(i = 0; i < N; i++ ){
    if(i%3 != 0 && i%5 != 0) {
      X + i;
    }
  }
  cout << X << endl;
}


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

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  
  for(int i = 0; i < N i++;)
    cin >> A[i];
  int M = 0;
  if (A[i]%3 != 0 && A[i]%5 != 0) {
    M + A[i];
  }
 cout >> M >>endl;
}


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

#include <iostream>
using namespace std;
int main() {
  int64_t n; cin >> n;
  int64_t a = n/3, b = n/5, c = n/15;
  cout << n*(n+1)/2 - a*(a+1)/2*3 - b*(b+1)/2*5 + c*(c+1)/2*15 << endl;
}

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

#include <iostream>

using namespace std;

int n;
long long sum;

int main()
{
  cin >> n;
  for (int i = 1; i <= n; i++)
    if (i % 3 != 0 and i % 5 != 0)
      sum += i;
  cout << sum;
  return 0;
}


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

include <stdio.h>
#include <stdint.h>

uint64_t sum_by(int base, int last) {
        uint64_t _last;

        if (base == 0) {
                perror("sum_by");
                return 1;
        }

        _last = last / base;

        return (_last * (_last + 1) / 2) * base;
}

uint64_t solve(int n) {
        return sum_by(1, n) - sum_by(3, n) - sum_by(5, n) + sum_by(15, n);
}

int main() {
        int n;
        int rc;

        rc = scanf("%7d", &n);
        if (rc == 0) {
                perror("scanf");
                return 1;
        }

        printf("%lld\n", solve(n));

        return 0;
}


Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'sum_by':
main.c:8:17: error: implicit declaration of function 'perror' [-Wimplicit-function-declaration]
    8 |                 perror("sum_by");
      |                 ^~~~~~
main.c: In function 'main':
main.c:25:14: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   25 |         rc = scanf("%7d", &n);
      |              ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include <stdint.h>
  +++ |+#include <stdio.h>
    3 | 
main.c:25:14: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   25 |         rc = scanf("%7d", &n);
      |              ^~~~~
main.c:25:14: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:31:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   31 |         printf("%lld\n", solve(n));
      |         ^~~~~~
main.c:31:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:31:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:31:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<iostream>
 
using namespace std;
 
int main(){
 
  long long n;
  cin>>n;
  long long i=1;
  long long sum = ((n)*(n+1))/2;
  while(i<=n){
  
    if((i%15)||(i%3)||(i%5)){
    	sum-=i;
      	i++;
    }
    
  }
  cout<<sum<<endl;
  return 0;


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

#include<iostream>
 
using namespace std;
 
int main(){
 
  long long n;
  cin>>n;
  long long i=1;
  long long sum = 0;
  while(i<=n){
  
    if((i%15)||(i%3)||(i%5)){
    	i++;
    }
    else{
    	sum+=i;
      	i++;
    }
    
  }
  cout<<sum<<endl;
  return 0;

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

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

int main() {
    using vi = vector<int>;
    
    int n;
    cin >> n;
    int sum = 0;
    rep(i,n) {
        if(i % 3 != 0 && i % 5 != 0) {
            sum += i;
        }
    }
    cout << sum << endl;
}

Compiler output:
main.c: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()
{
  int i, n ans;
   ans = 0 ;
  scanf("%d", &n);
  for(i = 1;i <= n;i++)
  {
    if(i %3 != 0 && i %5 != 0)
      ans += i;
  }
  printf("%d\n", ans);
}
  
  


Compiler output:
main.c: In function 'main':
main.c:5:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ans'
    5 |   int i, n ans;
      |            ^~~
main.c:6:4: error: 'ans' undeclared (first use in this function)
    6 |    ans = 0 ;
      |    ^~~
main.c:6:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:16: error: 'n' undeclared (first use in this function)
    7 |   scanf("%d", &n);
      |                ^
Language: C

int main()
{
  int i, n ans;
   ans = 0 ;
  scanf("%d", &n);
  for(i = 1;i <= n;i++)
  {
    if(i %3 != 0 && i %5 != 0)
      ans += i;
  }
  printf("%d\n", ans);
}
  
  


Compiler output:
main.c: In function 'main':
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ans'
    3 |   int i, n ans;
      |            ^~~
main.c:4:4: error: 'ans' undeclared (first use in this function)
    4 |    ans = 0 ;
      |    ^~~
main.c:4:4: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   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:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%d", &n);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:16: error: 'n' undeclared (first use in this function)
    5 |   scanf("%d", &n);
      |                ^
main.c:11:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   11 |   printf("%d\n", ans);
      |   ^~~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:11:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int main()
{
  int i, n ans;
  scanf("%d", &n);
  for(i = 1;i <= n;i++)
  {
    if(i %3 != 0 && i %5 != 0)
      ans += i;
  }
  printf("%d\n", ans);
}
  
  


Compiler output:
main.c: In function 'main':
main.c:3:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ans'
    3 |   int i, n ans;
      |            ^~~
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:4:16: error: 'n' undeclared (first use in this function)
    4 |   scanf("%d", &n);
      |                ^
main.c:4:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:7: error: 'ans' undeclared (first use in this function)
    8 |       ans += i;
      |       ^~~
main.c:10:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   10 |   printf("%d\n", ans);
      |   ^~~~~~
main.c:10:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:10:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:10:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

n =int(input())
count =0
for i in range(1,n):
    if (i %3) !=0:
        if (i %5) !=0:
            count +=i
print(count)

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n =int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:4: error: expected expression before 'int'
    1 | n =int(input())
      |    ^~~
Language: C

int main()
{
  int a, N,sum;
  for(a = 1;a <= N;a++)
  {  
   if(a %15 == 0)
    a = FizzBuzz;
   else if (a %3 == 0)
    a = Fizz;
   else if( a %5 == 0)
    a = Buzz;
   else 
    a == a;
    
    sum += a;
  }
}
  
  


Compiler output:
main.c: In function 'main':
main.c:7:9: error: 'FizzBuzz' undeclared (first use in this function)
    7 |     a = FizzBuzz;
      |         ^~~~~~~~
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:9: error: 'Fizz' undeclared (first use in this function)
    9 |     a = Fizz;
      |         ^~~~
main.c:11:9: error: 'Buzz' undeclared (first use in this function)
   11 |     a = Buzz;
      |         ^~~~
Language: C

int main()
{
  int a, sum;
  for(a = 1;a <= N;a++)
  {  
   if(a %15 == 0)
    a = FizzBuzz;
   else if (a %3 == 0)
    a = Fizz;
   else if( a %5 == 0)
    a = Buzz;
   else 
    a == a;
    
    sum += a;
  }
}
  
  


Compiler output:
main.c: In function 'main':
main.c:4:18: error: 'N' undeclared (first use in this function)
    4 |   for(a = 1;a <= N;a++)
      |                  ^
main.c:4:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:9: error: 'FizzBuzz' undeclared (first use in this function)
    7 |     a = FizzBuzz;
      |         ^~~~~~~~
main.c:9:9: error: 'Fizz' undeclared (first use in this function)
    9 |     a = Fizz;
      |         ^~~~
main.c:11:9: error: 'Buzz' undeclared (first use in this function)
   11 |     a = Buzz;
      |         ^~~~
Language: C

int main()
{
  int a, sum;
  for(a = 1;a <= N;a++)
  {  
   if(a %15 == 0)
    a == FizzBuzz;
   else if (a %3 == 0)
    a == Fizz;
   else if( a %5 == 0)
    a == Buzz;
   else 
    a == a;
    
    sum += a;
  }
}
  
  

Compiler output:
main.c: In function 'main':
main.c:4:18: error: 'N' undeclared (first use in this function)
    4 |   for(a = 1;a <= N;a++)
      |                  ^
main.c:4:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:10: error: 'FizzBuzz' undeclared (first use in this function)
    7 |     a == FizzBuzz;
      |          ^~~~~~~~
main.c:9:10: error: 'Fizz' undeclared (first use in this function)
    9 |     a == Fizz;
      |          ^~~~
main.c:11:10: error: 'Buzz' undeclared (first use in this function)
   11 |     a == Buzz;
      |          ^~~~