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

#include <iostream>
using namespace std;
int main(){
int n,x;
int a=0;
while(1){
cin>>n>>x;
if(n==0&&x==0){
break;
}
for(int i=1;i<=n;i++){
 for(int j=i+1;j<=n;j++){
   for(int k=j+1;k<=n;k++){
      if(i+j+k=x){
           a++;
        }
  }
}
}
cout<<a<<endl;
}
return 0;
}

 

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: lvalue required as left operand of assignment
   14 |       if(i+j+k=x){
      |          ~~~^~
Language: C++

(n, x) =  [int(i) for i in input().split()]
if n == x == 0:
    break

count = 0
for a in range(1, n+1):
    for b in range(a+1, n+1):
        for c in range(b+1, n+1):
            if (a + b + c) == x:
                count += 1
            elif (a + b + c) > x:
                break
print(count)
~                 

Compiler output:
a.cc:1:3: error: expected ')' before ',' token
    1 | (n, x) =  [int(i) for i in input().split()]
      | ~ ^
      |   )
a.cc:1:6: error: expected constructor, destructor, or type conversion before ')' token
    1 | (n, x) =  [int(i) for i in input().split()]
      |      ^
Language: C++

#include<stdio.h>

int main()
{
	int n, x;
	int i, j, k, total, sum=0;
	while (1)
	{
		scanf("%d %d", &n, &x);
		if (n == 0 && x == 0){ 
			break
		}
		for (i = 1; i <= n - 2; i++)
		{
			for (j = i + 1; j <= n - 1; j++)
			{
				for (k = j + 1; k <= n; k++)
				{
					total = i + j + k;
					if (total == x){
						sum += 1;
					}
				}
			}
		}
		printf("%d\n", sum);
	}
	return 0;
}

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

#include <stdio.h>

int main()
{
  while (1)
  {
    int n,x;
    scanf("%d %d", &n, &x);
    if (n == 0 && x == 0) break;
    int i, j, k, total, ways = 0;
    for (i = 1; i <= n - 2; i++)
    {
      for (j = i + 1; j <= n -1; j++)
      {
        for (k = j + 1; k <= n; k++)
        {
          total = i + j + k;
          if (total == x) ways += 1;
        }
      }
    }
    ptintf("%d\n", ways);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'ptintf' was not declared in this scope; did you mean 'printf'?
   22 |     ptintf("%d\n", ways);
      |     ^~~~~~
      |     printf
Language: C++

#include <iostream>
using namespace std;


int main(void){
	int n,x;
	c
	while(cin >> n >> x, !(n == 0, x == 0) ){
		int ct;
		for(int a1 = 1; a1 < ( n+1); a1++ ){
			for(int a2 = a1+1; a2 < (n+1); a2++){
				for(int a3 = a2+1; a3 < (n+1); a3++){
					if( (a1+a2+a3) == x ) ct++;
				}
			}
		}
		cout << ct << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'c' was not declared in this scope
    7 |         c
      |         ^
Language: C++

int main(){
	int n, x;
	int count = 0;
	while (1){
		cin >> n >> x;
		if (n == 0 && x == 0) break;
		for (int i = 0; i < n; i++){
			for (int j = 0; j < n; j++){
				for (int k = 0; k < n; k++){
					if (i < j&&j < k){
						if (i + j + k + 3 == x){
							count++;
						}
					}
				}
			}
		}
		cout << count;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:17: error: 'cin' was not declared in this scope
    5 |                 cin >> n >> x;
      |                 ^~~
a.cc:18:17: error: 'cout' was not declared in this scope; did you mean 'count'?
   18 |                 cout << count;
      |                 ^~~~
      |                 count
Language: C++

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

int main(){
int Ans[101][300];
int n[10],x[10];
int c=0;
memset(Ans,0,sizeof(Ans));
for(int i=3;i<=100;i++){
for(int j=3;j<=i;j++){
for(int k=2;k<j;k++){
for(int l=1;l<k;l++){
Ans[i][j+k+l]++;
}
}
}
}
for(int i=1;i<=100000;i++){
cin>>n[i]>>x[i];
if(x[i]==0 && n[i]==0){
goto Exit;
}
c++;
}
Exit:
for(int i=1;i<=c;i++){
cout<<Ans[n[i]][x[i]]<<endl;
}
return 0;
}

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

#include <iostream>
using namespace std;

int main() {
  int n, x;
  int v[n][n];
  int count = 0;
  int tmp;
  while (1) {
    cin >> n >> x;
    if (n ==0 && x ==0) {
      break;
    }
    for (int i = 1; i <= n - 2; i++) {
      for (int j = i + 1; j <= n - 1; j++) {
        for (int k = j + 1; k <= n; k++) {
          if ((i + j + k) == x) {
            count++;
          }
        }
      }
    }
    cout << count << Lendl;
  }
}

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

#include <iostream>
using namespace std;

int main()
{
	int n, x;

	while(true){
		int count = 0;
		cin >> n >> x;
		if(n == 0 && x == 0){
			break;
		}
		for(int i = 1; i <= n - 2; i++){
			for(int j = i + 1; j <= n - 1; j++){
				for(int k = j + 1; k <= n; k++){
					if((i + j + k) == x){
						count++;
					}
				}
			}
		}
		cout << count << endl;
	}
	

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

#include <iostream>
using namespace std;
???
int main() {
  int m, f, r;
  char g;
  while (true) {
    cin >> m >> f >> r;
    if (m == -1 && f == -1 && r == -1) return 0;
    if (m == -1 || f == -1) {
      g = 'F';
    } else if ((m + r) >= 80) {
      cout << "pass" << endl;
      g = 'A';
    } else if ((m + r) >= 65) {
      g = 'B';
    } else if ((m + r) >= 50) {
      g = 'C';
    } else if ((m + r) >= 30 ) {
      if (50 <= r) g = 'C';
      else g = 'D';
    } else {
      g = 'F';
    }
    cout << g << endl;
  }
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '?' token
    3 | ???
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,x,count,;
    count = 0;

    while(1){
        cin>>n>>x;
        if(n == 0 && x == 0)break;
        for (int i = 1; i <= n ; ++i) {
            for (int j = i+1; j <= n ; ++j) {
                for (int k = j+1; k <=n ; ++k) {
                    if (i+j+k == x) count ++;
                }
            }
        }
    }
cout << count << endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: expected unqualified-id before ';' token
    4 | int n,x,count,;
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,x,count,;
    count = 0;

    while(1){
        cin>>n>>x;
        if(n == 0 && x == 0)break;
        for (int i = 1; i <= n ; ++i) {
            for (int j = i+1; j <= n ; ++j) {
                for (int k = j+1; k <=n ; ++k) {
                    if (i+j+k == x){count ++; break;}
                }
            }
        }
    }
cout << count << endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: expected unqualified-id before ';' token
    4 | int n,x,count,;
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main(){
int n,x,count;
    count = 0;

    while(1){
        cin>>n>>x;
        if(n == 0 && x == 0)break;
        for(int i=1;i<x/3;i++){
            for(int j=i+1;j<x/2;j++){
                for(int k=j+1;k<=n;k++){
                    if(i+j+k==x){ count ++; break; }
                }
            }
        }
cout << count << endl;

return 0;
}

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

#include <iostream>
using namespace std;
 
int main() {
        int n, x;
        cin >> n >> x;
 
        if (n == 0 && x == 0) break;
 
        int ans = 0;
        for (int i = 1; i <= n; ++i) {
            for (int j = i + 1; j <= n; ++j) {
                for (int k = j + 1; k <= n; ++k) {
                    if (i + j + k == x) ++ans;
                }
            }
        }
 
        cout << ans << endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: break statement not within loop or switch
    8 |         if (n == 0 && x == 0) break;
      |                               ^~~~~
Language: C++

def ans (num, total, amax)
  if(num==1)
    if(total<=amax)
      1
    else
      0
  else
    sum=0
    for i in 1..amax do
      sum+=ans(num-1,total-i,amax)
    end
    sum
  end
end
      
  

while(true)
  a,b=gets.split(" ")
  if(a==0&&b==0) then
    break
  end
  d=ans(3 a b)
  puts(d)
end

  

Compiler output:
a.cc:9:14: error: too many decimal points in number
    9 |     for i in 1..amax do
      |              ^~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def ans (num, total, amax)
      | ^~~
Language: C++

#include <iostream>
using namespace std;

int main(){
        int n,x;

        while(cin >> n && n && cin >> x && x){
                int count = 0;
                for(int i=1;i<n-1;i++){
                        for(int j=i+1;j<n;j++){
                                for(int k=j+1; k<=n; k++){
                                        if(i + j + k == x) count++;
                                }
                        }
                }
                cout << count << endl;
        }
}

PS C:\Users\shuohang\data\cpp>

Compiler output:
a.cc:20:6: error: stray '\' in program
   20 | PS C:\Users\shuohang\data\cpp>
      |      ^
a.cc:20:12: error: stray '\' in program
   20 | PS C:\Users\shuohang\data\cpp>
      |            ^
a.cc:20:21: error: stray '\' in program
   20 | PS C:\Users\shuohang\data\cpp>
      |                     ^
a.cc:20:26: error: stray '\' in program
   20 | PS C:\Users\shuohang\data\cpp>
      |                          ^
a.cc:20:1: error: 'PS' does not name a type
   20 | PS C:\Users\shuohang\data\cpp>
      | ^~
Language: C++

#include <iostream>

using namespace std;

int n,x;
int ctn=0;
int main(){
  cin>>n>>x;
  while(n!=&&x!=0){
   for (int i=1;i<n;i++){
    for(int j=i;j<n;j++){
     for(int k=j;k<n;k++){
      if(i+j+k==n){
       ctn++;
      }
     }
    } 
   }
   cout<<ctn<<endl;
   }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    9 |   while(n!=&&x!=0){
      |         ~^~~~~
a.cc:9:14: error: label 'x' used but not defined
    9 |   while(n!=&&x!=0){
      |              ^
Language: C++

#include <iostream>
using namespace std;

int count_common(){
  int n, x, count = 0;

  while(true){
    cin >> n >> x;
    if(n == 0 && x == 0) break;

    for(int i = n; i >= 3; i--){
      for(int j = i - 1; j >= 2; j--){
        for(int k = j - 1; k >= 1; k--){
          if( i == j || j == k || k == i) continue;
          if((i + j + k) == x) count += 1;
        }
      }
    }

    cout << count << endl;
  }
  return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>

using namespace std;

int main(){
	int n = 0, x = 0;
	
	while(1){

		cin >> n >> x;
		cnt = 0;
		
		if( n == 0 && x == 0 ) break;
		
		for ( int i = 1; i <= (n-2); i++ ){
			for ( int j = i+1; j <= (n-1); j++ ){
				for ( int k = j+1; k <= n; k++ ){
					if( i + j + k == x ) 
						cnt ++;
				}
			}
		}
		cout << cnt << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |                 cnt = 0;
      |                 ^~~
      |                 int
Language: C++

#include <iostream>

using namespace std;

int main(void)
{
  int n, x;
  while(1){
    int flag = 0;
    cin >> n >> x;
    if(n+x == 0) break;
    for(i = 1; i <= n; i++){
      for(j = i+1; j <= n; j++){
	for(k = j+1; k <= n; k++){
	  if(i+j+k == x){
	    flag += 1;
	  }
	}
      }
    }
    cout << flag << '\n';
  }
}

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

#include <iostream>

using namespace std;

int main(void)
{
  int n, x;
  int flag;
  while(1){
    flag = 0;
    cin >> n >> x;
    if(n+x == 0) break;
    for(i = 1; i <= n; i++){
      for(j = i+1; j <= n; j++){
	for(k = j+1; k <= n; k++){
	  if(i+j+k == x){
	    flag += 1;
	  }
	}
      }
    }
    cout << flag << '\n';
  }
}


	    
  

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

#include<iostream>
using namespace std;

int main()
{
    int a = 0, n, x;
    cin >> n >> x;
    for (int i = 1; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            for (int k = j + 1; j <= n; k++) {
                if (i + j + k = x)a++;
                else continue;
            }
        }
    }
    cout << a << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: lvalue required as left operand of assignment
   11 |                 if (i + j + k = x)a++;
      |                     ~~~~~~^~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
    int a = 0, n, x;
    cin >> n >> x;
    for (int i = 1; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            for (int k = j + 1; j <= n; k++) {
                if (i + j + k = x)a++;
            }
        }
    }
    cout << a << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: lvalue required as left operand of assignment
   11 |                 if (i + j + k = x)a++;
      |                     ~~~~~~^~~
Language: C++

#include<iostream>
using namespace std;

int main(){
     int n,x,ct;
          while(1){
               cin>>n>>x;
               if(n==0&&x==0) break;
               
               for(int i=1;i<n-1;i++){
                    for(int j==i+1;j<n;j++){
                         for(k==j+1;j<n+1;j++){
                              if(i+j+k==x) ct+=1;
                         }
                    }
               }
          }
          cout<<ct<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: expected ';' before '==' token
   11 |                     for(int j==i+1;j<n;j++){
      |                              ^~
      |                              ;
a.cc:11:30: error: expected primary-expression before '==' token
   11 |                     for(int j==i+1;j<n;j++){
      |                              ^~
a.cc:11:39: error: expected ')' before ';' token
   11 |                     for(int j==i+1;j<n;j++){
      |                        ~              ^
      |                                       )
a.cc:11:40: error: 'j' was not declared in this scope
   11 |                     for(int j==i+1;j<n;j++){
      |                                        ^
Language: C++

#include<iostream>
using namespace std;

int main(){
     int n,x,ct;
          while(1){
               cin>>n>>x;
               if(n==0&&x==0) break;
               
               for(int i=1;i<n-1;i++){
                    for(int j=i+1;j<n;j++){
                         for(k=j+1;j<n+1;j++){
                              if(i+j+k==x) ct+=1;
                         }
                    }
               }
          }
          cout<<ct<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: 'k' was not declared in this scope
   12 |                          for(k=j+1;j<n+1;j++){
      |                              ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int n,x;
	while(1){
		cin >> n >> x;
	    if(n + x == 0) break;
	    t = 0;
	    for(int i = 1;i <= n;i++){
	    	for(int j = i + 1;j <= n;j++){
	    		for(int k = j + 1;k <= n;k++){
	    			if(i + j + k == x) t++;
	    			}
	    		}
	    	}
	    cout << t << endl;
	   }
	    return 0;
	    }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 't' was not declared in this scope
   10 |             t = 0;
      |             ^
Language: C++

#include<iostream>

int main()
{
    int number;
    int sum;
    int count = 0;
    while (true) {
        std::cin >> number >> sum;
        if (number == 0 && sum == 0) break;
        for (int x = 1; x <= number; x++) {
            for (int y = x + 1; y <= number; y++) {
                for (int z = y + 1; z <= number; z++) {
                    if (x + y + z  == sum) count++;
                }
            }
        }
        std::cout << count << std::endl;
    }

    return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   21 |     return;
      |     ^~~~~~
Language: C++

#include<iostream>

int main()
{
    int n;
    int x;
    int count = 0;
    while (true) {
        std::cin >> n >> x;
        if (n == 0 && x == 0) break;
        for (int a = 1; a <= number; a++) {
            for (int b = a + 1; b <= number; b++) {
                for (int c = b + 1; c <= number; c++) {
                    if (a + b + c  == x) count++;
                }
            }
        }
        std::cout << count << std::endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:30: error: 'number' was not declared in this scope
   11 |         for (int a = 1; a <= number; a++) {
      |                              ^~~~~~
Language: C++

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


int eval(int x, int y) {
  int i, j, k, cnt =0;
  for(int i = 1 ; i <= x; i++) {
  for(int j = i+1 ; j <= x; j++) {
  for(int k = j+1 ; k <= x; k++) {
    if (i + j + k == y) {
cnt++;
    }
 }
  }}
  return  cnt;
}

int main() {

 int x, y;
 while(cin >> x >> y, x + y != 0 ) {
  cout << eval(x, y) << endl;
 }

}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:22:8: error: 'cin' was not declared in this scope
   22 |  while(cin >> x >> y, x + y != 0 ) {
      |        ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <cstdio>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout << eval(x, y) << endl;
      |   ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:25: error: 'endl' was not declared in this scope
   23 |   cout << eval(x, y) << endl;
      |                         ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <cstdio>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include<stdio.h>
int main(void)
{
  int n, x, i, sum, j, k;
  scanf("%d %d",&n,&x);
  while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1; j<= i+1 ; j<= n-1; j++){
   for(k=1; k<= n; k++){
    if(i+j+k==x) {
     sum+=1;
     break;
     }
    }
   }
  cout << sum << end1;
  }
  return 0;
 }

 
 

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> n >> x;
      |   ^~~
a.cc:12:29: error: expected ')' before ';' token
   12 |   for(j=1; j<= i+1 ; j<= n-1; j++){
      |      ~                      ^
      |                             )
a.cc:12:34: error: expected ';' before ')' token
   12 |   for(j=1; j<= i+1 ; j<= n-1; j++){
      |                                  ^
      |                                  ;
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout << sum << end1;
      |   ^~~~
a.cc:20:18: error: 'end1' was not declared in this scope
   20 |   cout << sum << end1;
      |                  ^~~~
a.cc:23:3: error: expected '}' at end of input
   23 |  }
      |   ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

#include<stdio.h>
using namespace std;
 

int main(void)
{
  int n, x, i, sum, j, k;
  scanf("%d %d",&n,&x);
  while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1; j<= i+1 ; j<= n-1; j++){
   for(k=1; k<= n; k++){
    if(i+j+k==x) {
     sum+=1;
     break;
     }
    }
   }
  cout << sum << end1;
  }
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> n >> x;
      |   ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<stdio.h>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:15:29: error: expected ')' before ';' token
   15 |   for(j=1; j<= i+1 ; j<= n-1; j++){
      |      ~                      ^
      |                             )
a.cc:15:34: error: expected ';' before ')' token
   15 |   for(j=1; j<= i+1 ; j<= n-1; j++){
      |                                  ^
      |                                  ;
a.cc:23:3: error: 'cout' was not declared in this scope
   23 |   cout << sum << end1;
      |   ^~~~
a.cc:23:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:18: error: 'end1' was not declared in this scope
   23 |   cout << sum << end1;
      |                  ^~~~
a.cc:26:3: error: expected '}' at end of input
   26 |  }
      |   ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
 

int main(void)
{
  int n, x, i, sum, j, k;
  scanf("%d %d",&n,&x);
  while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1; j<= i+1 ; j<= n-1; j++){
   for(k=1; k<= n; k++){
    if(i+j+k==x) {
     sum+=1;
     break;
     }
    }
   }
  cout << sum << end1;
  }
  return 0;
 }

 
 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: expected ')' before ';' token
   15 |   for(j=1; j<= i+1 ; j<= n-1; j++){
      |      ~                      ^
      |                             )
a.cc:15:34: error: expected ';' before ')' token
   15 |   for(j=1; j<= i+1 ; j<= n-1; j++){
      |                                  ^
      |                                  ;
a.cc:23:18: error: 'end1' was not declared in this scope
   23 |   cout << sum << end1;
      |                  ^~~~
a.cc:26:3: error: expected '}' at end of input
   26 |  }
      |   ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
 

int main(void)
{
  int n, x, i, sum, j, k;
  scanf("%d %d",&n,&x);
  while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1+i; j<= n-1; j++){
   for(k=1+j; k<= n; k++){
    if(i+j+k==x) {
     sum+=1;
     break;
     }
    }
   }
  cout << sum << end1;
  }
  return 0;
 }

 
 

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: 'end1' was not declared in this scope
   23 |   cout << sum << end1;
      |                  ^~~~
a.cc:26:3: error: expected '}' at end of input
   26 |  }
      |   ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'a' was not declared in this scope
    7 |       if(a == 0&&b == 0){
      |          ^
a.cc:7:18: error: 'b' was not declared in this scope
    7 |       if(a == 0&&b == 0){
      |                  ^
Language: C++

#include<iostream>
using namespace std;
 

int main(void)
{
  int n, x, i, sum, j, k;
  scanf("%d %d",&n,&x);
  while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1+i; j<= n-1; j++){
   for(k=1+j; k<= n; k++){
    if(i+j+k==x) 
     sum+=1;
    
    }
   }
  }
   cout << sum << end1;
  }
 
  return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: 'end1' was not declared in this scope
   23 |    cout << sum << end1;
      |                   ^~~~
Language: C++

#include<iostream>
using namespace std;
 

int main(void)
{
  int n, x, i, sum, j, k;
  scanf("%d %d",&n,&x);
  while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1+i; j<= n-1; j++){
   for(k=1+j; k<= n; k++){
    if(i+j+k==x) 
     sum+=1;
    
    }
   }
  }
   cout << sum << end1;
  }
 
  

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: 'end1' was not declared in this scope
   23 |    cout << sum << end1;
      |                   ^~~~
a.cc:24:4: error: expected '}' at end of input
   24 |   }
      |    ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
 

int main()
{
  int n, x, i, sum, j, k;
  scanf("%d %d",&n,&x);
  while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1+i; j<= n-1; j++){
   for(k=1+j; k<= n; k++){
    if(i+j+k==x) 
     sum+=1;
    
    }
   }
  }
   cout << sum << end1;
  }
 
  

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: 'end1' was not declared in this scope
   23 |    cout << sum << end1;
      |                   ^~~~
a.cc:24:4: error: expected '}' at end of input
   24 |   }
      |    ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<iostream>
using namespace std;
 

int main()
{
  int n, x, i, sum, j, k;
    while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1+i; j<= n-1; j++){
   for(k=1+j; k<= n; k++){
    if(i+j+k==x) 
     sum+=1;
    
    }
   }
  }
   cout << sum << end1;
  }
 
  

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: 'end1' was not declared in this scope
   22 |    cout << sum << end1;
      |                   ^~~~
a.cc:23:4: error: expected '}' at end of input
   23 |   }
      |    ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include <stdio.h>
int main()
{
  int n, x, i, j, k, w=0;
  scanf(%d %d, &n, &x);

  do{
   for(i=1; i<j; i++)
    for(j=i+1; j<k; j++)
     for(k=j+1; k<n; k++)
      if(i+k+j==x)  w+=1;

   printf("%d",w);
   scanf(%d %d, &n, &x);
  }while(n==0 && x==0)

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected primary-expression before '%' token
    5 |   scanf(%d %d, &n, &x);
      |         ^
a.cc:5:10: error: 'd' was not declared in this scope
    5 |   scanf(%d %d, &n, &x);
      |          ^
a.cc:14:10: error: expected primary-expression before '%' token
   14 |    scanf(%d %d, &n, &x);
      |          ^
a.cc:15:23: error: expected ';' before 'return'
   15 |   }while(n==0 && x==0)
      |                       ^
      |                       ;
   16 | 
   17 |   return 0;
      |   ~~~~~~
Language: C++

#include<iostream>
using namespace std;
 

int main()
{
  int n, x, i, sum, j, k;
  scanf("%d %d",&n,&x);
  while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1+i; j<= n-1; j++){
   for(k=1+j; k<= n; k++){
    if(i+j+k==x) 
     sum+=1;
    
    }
   }
  }
   cout << sum << end1;
  }
 }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:23:19: error: 'end1' was not declared in this scope
   23 |    cout << sum << end1;
      |                   ^~~~
Language: C++

#include<iostream>
using namespace std;
 

int main()
{
  int n, x, i, sum, j, k;
   while(1){
  cin >> n >> x;
  if( n + x == 0) break;
  sum=0;

 for(i=1; i<= n-2;i++){
  for(j=1+i; j<= n-1; j++){
   for(k=1+j; k<= n; k++){
    if(i+j+k==x) 
     sum+=1;
    
    }
   }
  }
   cout << sum << end1;
  }
 }
  

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

#include <stdio.h>
int main()
{
  int n, x, i, j, k, w=0;
  scanf("%d %d", &n, &x);

  do{
   for(i=1; i<j; i++)
    for(j=i+1; j<k; j++)
     for(k=j+1; k<n; k++)
      if(i+k+j==x)  w+=1;

   printf("%d"\n, w);
   scanf("%d %d", &n, &x);
  }while(n==0 && x==0)

  return 0;
}

Compiler output:
a.cc:13:15: error: stray '\' in program
   13 |    printf("%d"\n, w);
      |               ^
a.cc: In function 'int main()':
a.cc:13:15: error: expected ')' before 'n'
   13 |    printf("%d"\n, w);
      |          ~    ^~
      |               )
a.cc:15:23: error: expected ';' before 'return'
   15 |   }while(n==0 && x==0)
      |                       ^
      |                       ;
   16 | 
   17 |   return 0;
      |   ~~~~~~
Language: C++

#include <stdio.h>
int main()
{
  int n, x, i, j, k, w=0;
  scanf("%d %d", &n, &x);

  do{
   for(i=1; i<j; i++)
    for(j=i+1; j<k; j++)
     for(k=j+1; k<n; k++)
      if(i+k+j==x)  w+=1;

   printf("%d\n", w);
   scanf("%d %d", &n, &x);
  }while(n==0 && x==0)

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: expected ';' before 'return'
   15 |   }while(n==0 && x==0)
      |                       ^
      |                       ;
   16 | 
   17 |   return 0;
      |   ~~~~~~
Language: C++

#include<stdio.h>
 
int main()
{
   int n, x, i, j, k;
   int A = 0;
 
   while(1) {
      scanf("%d %d\n",&n &x);
      if(n==0 && x==0)
         break;
      for(i=1; i<=n; i++) {
         for(j=i+1; j<=n; j++) {
            for(k=j+1; k<=n; k++) {
               if(i+j+k == x) {
                  A++;
               }
            }
         }
      }
      printf("%d\n", A);
   }
   return 0;
}
 
                      

Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: invalid operands of types 'int*' and 'int' to binary 'operator&'
    9 |       scanf("%d %d\n",&n &x);
      |                       ~~ ^~
      |                       |   |
      |                       |   int
      |                       int*
Language: C++

#include <stdio.h>
int main()
{
  int n, x, i, j, k, w=0, y=0;
  scanf("%d %d", &n, &x);

  do{
   for(i=1; i<j; i++){
    for(j=i+1; j<k; j++){
     for(k=j+1; k<n; k++){
      y=i+j+k;
      if(y==x)  w++;}}}

   printf("%d\n", w);
   w=0;
  scanf("%d %d", &n, &x); 
  }while(n==0 && x==0)

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected ';' before 'return'
   17 |   }while(n==0 && x==0)
      |                       ^
      |                       ;
   18 | 
   19 |   return 0;
      |   ~~~~~~
Language: C++

#include <stdio.h>
int main()
{
	int n, i, j, k, w, x, y;
	scanf_s("%d %d", &n, &x);

	do {
		w = 0;
		for (i = 1; i <= n-2; i++)
			for (j = i+1; j <= n-1; j++)
				for (k = j+1; k <= n; k++){
					y = i + j + k;
		            if (y == x) w+=1;}
		printf("%d\n", w);

		scanf_s("%d %d", &n, &x);
	} while (n!=0 && x!=0);

	return 0;
}

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

#include<iostream>
using namespace std;

int count(int n, int x){
  int cnt;
  for (int i = 1; i <= n-2; i++) {
     for (int j = i+1; j <= n-1; j++) {
       for (int k = j+1; k <= n; k++) {
         if (i < j && j < k && i + j + k == x) cnt++;
       }
     }
  }

}

int main(){
  while(1){
    int n, x;
    cin >> n >> x;
    if (n == 0 && x == 0) break;

    cout << count(n, x) << endl;

return 0;
}

Compiler output:
a.cc: In function 'int count(int, int)':
a.cc:14:1: warning: no return statement in function returning non-void [-Wreturn-type]
   14 | }
      | ^
a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:16:11: note: to match this '{'
   16 | int main(){
      |           ^
Language: C++

int culculate(int n, int x) {
	int i, j, k, amari1, amari2, count = 0;
	
	for (i = 1; i < n - 1; i++)
	{
		amari1 = x - i;
		if (amari1 >= i + 1 && amari1 <= n)
		{
			for (j = i + 1; j < n; j++)
			{
				amari2 = x - ( i + j );
				if (amari2 >= j + 1 && amari2 <= n)
				{
					count++;
				}
				else
				{
					break;
				}
			}
		}
		else
		{
			break;
		}
	}
	
	return count;
}

int main(void) {
	int n, x;
	
	do
	{
		scanf("%d %d", &n, &x);
		if (n != 0 || x != 0)
		{
			printf("%d\n", culculate(n, x));
		}
	} while (n != 0 || x != 0);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:17: error: 'scanf' was not declared in this scope
   36 |                 scanf("%d %d", &n, &x);
      |                 ^~~~~
a.cc:39:25: error: 'printf' was not declared in this scope
   39 |                         printf("%d\n", culculate(n, x));
      |                         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int culculate(int n, int x) {
Language: C++

package Intro;

import java.util.Scanner;


public class Main{

	public static int  Clc(int N , int X) {
		int count = 0;
		for(int x = 1; x <= N ; x++){
			for(int y = 2; y <= N ; y++){
				if(x==y){break;}
				for(int z =3 ; z <= N ; z++){
					if(x==z || y == z){break;}
						if((x+y+z)==X){count++;}
				}
			}
		}

		return count;


	}

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int count = 0;

		while(true){
			int N = scanner.nextInt();
			int X = scanner.nextInt();
			if(N == 0 && X == 0){break;}
			count = Clc(N, X);
			System.out.print(count);
		}
	}


}

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

#include<iostream>
using namespace std;

int main() {
        int n[100], x[100], result[100]; i, j, k, l, m;
        for (i = 0; i < 100; i++) {
                result[i] = 0;
                cin >> n[i] >> x[i];
                if (n[i] == 0 && x[i] == 0) break;
        }
        for (m = 0; m < i; m++) {
                for (j = 1; j < n[m] + 1; j++) {
                        for (k = 1; k < n[m] + 1; k++) {
                                for (l = 1; l < n[m] + 1; l++) {
                                        if (j != k && k != l && j != l) {
                                                if (j + k + l == x[m]) {
                                                        result[m]++
                                                }
                                        }
                                }
                        }
                }
        }
        for (m = 0; m < i; m++) {
                cout << result[m] / 6 << endl;1
        }
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:42: error: 'i' was not declared in this scope
    5 |         int n[100], x[100], result[100]; i, j, k, l, m;
      |                                          ^
a.cc:5:45: error: 'j' was not declared in this scope
    5 |         int n[100], x[100], result[100]; i, j, k, l, m;
      |                                             ^
a.cc:5:48: error: 'k' was not declared in this scope
    5 |         int n[100], x[100], result[100]; i, j, k, l, m;
      |                                                ^
a.cc:5:51: error: 'l' was not declared in this scope
    5 |         int n[100], x[100], result[100]; i, j, k, l, m;
      |                                                   ^
a.cc:5:54: error: 'm' was not declared in this scope
    5 |         int n[100], x[100], result[100]; i, j, k, l, m;
      |                                                      ^
a.cc:25:48: error: expected ';' before '}' token
   25 |                 cout << result[m] / 6 << endl;1
      |                                                ^
      |                                                ;
   26 |         }
      |         ~
Language: C++

#include<iostream>
using namespace std;

int main() {
        int n[100], x[100], result[100], i, j, k, l, m;
        for (i = 0; i < 100; i++) {
                result[i] = 0;
                cin >> n[i] >> x[i];
                if (n[i] == 0 && x[i] == 0) break;
        }
        for (m = 0; m < i; m++) {
                for (j = 1; j < n[m] + 1; j++) {
                        for (k = 1; k < n[m] + 1; k++) {
                                for (l = 1; l < n[m] + 1; l++) {
                                        if (j != k && k != l && j != l) {
                                                if (j + k + l == x[m]) {
                                                        result[m]++
                                                }
                                        }
                                }
                        }
                }
        }
        for (m = 0; m < i; m++) {
                cout << result[m] / 6 << endl;1
        }
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:68: error: expected ';' before '}' token
   17 |                                                         result[m]++
      |                                                                    ^
      |                                                                    ;
   18 |                                                 }
      |                                                 ~                   
a.cc:25:48: error: expected ';' before '}' token
   25 |                 cout << result[m] / 6 << endl;1
      |                                                ^
      |                                                ;
   26 |         }
      |         ~
Language: C++

#include<iostream>
using namespace std;

int main(){
 int n,x,l;
 while(1){
  cin >> n >> x;
  if(n==0&&x==0) break;
  l=0;
  for(int i=1;i<=n-2;++i){
   for(int j=i+1;j<=n-1;++j){
    for(int k=i+2;k<=n;++k){
     if(i+j+k==x) l+=l;
    }
   }
  }
 cout << l << endl;
 return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int maini(){
	while(1){
		int n,x,cnt=0;
		cin >> n>> x;
		if(n==0&&x==0) return 0;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=n;j++){
				for(int k=1;k<=n;k++){
					if(i==j||j==k||i==k) continue;
					else if(i+j+k==x) cnt++;
				}
			}
		}
		cout<<cnt<<endl;
	}
	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<stdio.h>
int main(void){
    int i;
    int n[10000];
    int x[10000];
    int length=0;
    do{
        scanf("%d %d", &n[length], &x[length]);
        length++;
    }while(n==0 && x==0);
    for(i=0; i<length; i++){
        int m[3];
        int xm[3];
        int count=0;
        m[0]=1; m[1]=2; m[2]=x[i]-m[0]-m[1]
        while(m[0]<m[1]&&m[1]<m[2]){
            xm[0]=m[0]; xm[1]=m[1]; xm[2]=m[2];
            while(m[1]<m[2]){
                if(m[2]<=n[i]){
                    count++;
                }
                m[1]=m[1]-1;
                m[2]=m[2]-1;
            }
            m[0]=xm[0]+1; m[1]=xm[1]+1; m[2]=xm[2]-m[0]-m[1]
        }
        printf("%d\n", count);
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:44: error: expected ';' before 'while'
   15 |         m[0]=1; m[1]=2; m[2]=x[i]-m[0]-m[1]
      |                                            ^
      |                                            ;
   16 |         while(m[0]<m[1]&&m[1]<m[2]){
      |         ~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	while(true){
		int n, x;
		cin >> n >> x;
		if (n == 0 && x == 0) return 0;

		int d = 0;
		for (int i = 1; i <= n; i++) {
			for (int j = i + 1; j <= n; j++) {
				for (int k = j + 1; k <= n; k++)
					if (i + j + k == x) d++;
			}
		}

		cout << d << endl;
	}
	_getch();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: '_getch' was not declared in this scope; did you mean 'getc'?
   20 |         _getch();
      |         ^~~~~~
      |         getc
Language: C++

#include <ciostream>
using namespace std;
int main(){
int i,j,k,n,x,p,q = 0;
    for (;;){
        cin >> n >> x;
        if(n == 0 && x == 0)break;	
        	for (i = 1;i <= n;i++){
        		for (j = i+1;j <=  n ;j++){
					for (k = j+1;k <= n;k++){
                        	 p = i + j + k;

                        	    if (p == x){
                        	    	q = q + 1;

                        	        }  				
					    }
        			}
        	}
        	cout << q << endl;
    }    

    return 0 ;
} ???

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

#include <iostream>

int main()
{
	int n,x,count = 0;
	
	while(1)
	{
		cin >> n >> x;
		if(n == 0 && x == 0) break;
		
		for(int i = 1; i <= n-2; i++)
		{
			for(int j = i+1; j <= n-1; j++)
			{
				for(int k = j+1; k <= n; k++)
				{
					if(i+j+k == x) count++;
				}
			}
		}
		cout << count << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |                 cin >> n >> x;
      |                 ^~~
      |                 std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:22:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |                 cout << count << endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:34: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |                 cout << count << endl;
      |                                  ^~~~
      |                                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
	int n,x;
	
	while(1)
	{
		cin >> n >> x;
		if(n == 0 && x == 0) break;
		
		count = 0;
		
		for(int i = 1; i <= n-2; i++)
		{
			for(int j = i+1; j <= n-1; j++)
			{
				for(int k = j+1; k <= n; k++)
				{
					if(i+j+k == x) count++;
				}
			}
		}
		cout << count << endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'count' was not declared in this scope
   14 |                 count = 0;
      |                 ^~~~~
Language: C++

#include<stdio.h>
int main(void){
int n,x,i,kazu;
int y=0,c=0;
	
		for(;;){
		kazu=0;

		scanf("%d %d",&n,&x);
		if(n==0||x==0){
			break;
		}
		for(i=1;i<=n;i++){

			for(y=1;y<=n;y++){

				for(c=1;c<=n;c++){
					if(i==y||y==c||c==i){
						}else if(i+y+c==x&&i<y&&y<c){
						kazu++;
						}
					
				}
				
			}
			
		}
			printf("%d\n",kazu);
		}
						
					

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

#include<stdio.h>
int main(void){
int n,x,i,y,c,kazu;

	
		for(;;){
		kazu=0;

		scanf("%d %d",&n,&x);
		if(n==0||x==0){
			break;
		}
		for(i=1;i<=n;i++){

			for(y=1;y<=n;y++){

				for(c=1;c<=n;c++){
					if(i!=y&&y!=c&&c!=i){
					if(i+y+c==x&&i<y&&y<c){
						kazu++;
						}
					}
				}
				
			}
			
		}
			printf("%d\n",kazu);
		}
		return 0;

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

#include<iostream>
using namespace std;

int count(int n,int x){
int cnt = 0;
for(i=1;i<=n-2;i++){
 for(j=i+1;j<=n-1;j++){
  for(k=j+1;k<=n;k++){
if(i+j+k==x) cnt++;
  }
 }
}
return cnt;
}
int main(){
int n,x;
while(1){
cin >>n >>x;
if(n==0 && x==0) break;
else cout << count(n,x) <<endl;
return 0;
}
}

Compiler output:
a.cc: In function 'int count(int, int)':
a.cc:6:5: error: 'i' was not declared in this scope
    6 | for(i=1;i<=n-2;i++){
      |     ^
a.cc:7:6: error: 'j' was not declared in this scope
    7 |  for(j=i+1;j<=n-1;j++){
      |      ^
a.cc:8:7: error: 'k' was not declared in this scope
    8 |   for(k=j+1;k<=n;k++){
      |       ^
Language: C++

#include<iostream>
using namespace std;

int count(int n,int x){
int cnt = 0;
for(i=1;i<=n-2;i++){
??for(j=i+1;j<=n-1;j++){
????for(k=j+1;k<=n;k++){
if(i+j+k==x) cnt++;
????}
??}
}
return cnt;
}

int main(){
int n,x;
while(1){
cin >>n >>x;
if(n==0 && x==0) break;
cout << count(n,x) <<endl;
}
return 0;
}

Compiler output:
a.cc: In function 'int count(int, int)':
a.cc:6:5: error: 'i' was not declared in this scope
    6 | for(i=1;i<=n-2;i++){
      |     ^
a.cc:7:1: error: expected primary-expression before '?' token
    7 | ??for(j=i+1;j<=n-1;j++){
      | ^
a.cc:7:2: error: expected primary-expression before '?' token
    7 | ??for(j=i+1;j<=n-1;j++){
      |  ^
a.cc:7:3: error: expected primary-expression before 'for'
    7 | ??for(j=i+1;j<=n-1;j++){
      |   ^~~
a.cc:7:3: error: expected ':' before 'for'
    7 | ??for(j=i+1;j<=n-1;j++){
      |   ^~~
      |   :
a.cc:7:3: error: expected primary-expression before 'for'
    7 | ??for(j=i+1;j<=n-1;j++){
      |   ^~~
a.cc:7:3: error: expected ':' before 'for'
    7 | ??for(j=i+1;j<=n-1;j++){
      |   ^~~
      |   :
a.cc:7:3: error: expected primary-expression before 'for'
    7 | ??for(j=i+1;j<=n-1;j++){
      |   ^~~
a.cc:7:13: error: 'j' was not declared in this scope
    7 | ??for(j=i+1;j<=n-1;j++){
      |             ^