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

#include <stdio.h>

int main(){
    int i, j, k;
    int n, x, s;
    scanf("%d %d", &n, &x)
      while(n!=0 || x!=0){
        s = 0;
                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){
                        ++s;
                    }
                }
            }
        }
        
        printf("%d\n", s);
    }
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:27: error: expected ';' before 'while'
    6 |     scanf("%d %d", &n, &x)
      |                           ^
      |                           ;
    7 |       while(n!=0 || x!=0){
      |       ~~~~~
Language: C

#include <stdio.h>
int main(){
  int i, j, k;
  int n, x, s;
    scanf("%d %d", &n, &x)
      while(n>0 || x>0){
        s=0;
	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){
		++s;
	      }
	    }
	  }
        }
        
        printf("%d\n", s);
    }
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:27: error: expected ';' before 'while'
    5 |     scanf("%d %d", &n, &x)
      |                           ^
      |                           ;
    6 |       while(n>0 || x>0){
      |       ~~~~~
Language: C++

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

while(true){

	cin>>n>>x;
	if(n==0&&x==0)break;
		int count=0;
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			for(int l=j+1;l<=n;l++){
			cout<<i<<" "<<j<<" " <<l<<endl;
			//	int s=i+j+l;
				if(s==x)count++;
				else if(s>x)break;
			}
		
		}
	
	}
	cout<<count<<endl;
}
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:36: error: 's' was not declared in this scope
   16 |                                 if(s==x)count++;
      |                                    ^
Language: C++

#include <iostream>

using namespace std;

int main(){
	int n,x;
	int count = 0;
	while(cin >> n >> x, n && x){
		count = 0;
		for (int a = 1; a <= n; a++)
		{
			for (int b = 2; b <= n; b++)
			{
				for (int c = 3; c <= n; c++)
				{
					if (a + b + c == x && a<b && b<c && a<0 0 c)
					{
						count++;
					}
				}
			}
		}
		cout << count << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:80: error: expected ')' before numeric constant
   16 |                                         if (a + b + c == x && a<b && b<c && a<0 0 c)
      |                                            ~                                   ^~
      |                                                                                )
Language: C++

#include<stdio.h>
int main(){
  int n,x,i,j,k;
  while(1){
    y=0;
    scanf("%d %d",&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){
	    y++;
	  }
	}
    }
  }
  printf("%d\n",y);
  }
  return(0);
}

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

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int a,b;
	while(cin>>a>>b,a+b){
		int co==0;
		rep(i,n)rep(j,n)rep(k,n)if(i+j+k==b-3)co++;
		cout<<co<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: expected initializer before '==' token
   25 |                 int co==0;
      |                       ^~
a.cc:26:23: error: 'n' was not declared in this scope
   26 |                 rep(i,n)rep(j,n)rep(k,n)if(i+j+k==b-3)co++;
      |                       ^
a.cc:12:35: note: in definition of macro 'loop'
   12 | #define loop(i,a,b) for(int i=a;i<b;i++)
      |                                   ^
a.cc:26:17: note: in expansion of macro 'rep'
   26 |                 rep(i,n)rep(j,n)rep(k,n)if(i+j+k==b-3)co++;
      |                 ^~~
a.cc:26:55: error: 'co' was not declared in this scope; did you mean 'cos'?
   26 |                 rep(i,n)rep(j,n)rep(k,n)if(i+j+k==b-3)co++;
      |                                                       ^~
      |                                                       cos
a.cc:27:23: error: 'co' was not declared in this scope; did you mean 'cos'?
   27 |                 cout<<co<<endl;
      |                       ^~
      |                       cos
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int a,b;
	while(cin>>a>>b,a+b){
		int co=0;
		rep(i,n)rep(j,n)rep(k,n)if(i+j+k==b-3)co++;
		cout<<co<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: 'n' was not declared in this scope
   26 |                 rep(i,n)rep(j,n)rep(k,n)if(i+j+k==b-3)co++;
      |                       ^
a.cc:12:35: note: in definition of macro 'loop'
   12 | #define loop(i,a,b) for(int i=a;i<b;i++)
      |                                   ^
a.cc:26:17: note: in expansion of macro 'rep'
   26 |                 rep(i,n)rep(j,n)rep(k,n)if(i+j+k==b-3)co++;
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;

int main(void)
{
	int n, x;
	int kai;

	while (1)
	{
		cin >> n >> x;
		kai = 0;
		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) kai++;
				}
			}
		}

		cout << kai << endl;
	}
	return 0;

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

using System;
using System.Collections.Generic;

namespace _10017
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string[] readline = Console.ReadLine().Split(' ');
                int a = int.Parse(readline[0]);
                int b = int.Parse(readline[1]);

                if (a == 0 && b == 0) break;

                int count = 0;
                for (int i = 1; i <= a; i++)
                {
                    for (int j = i + 1; j <= a; j++)
                    {
                        for (int k = j + 1; k <= a; k++)
                        {
                            if ((i != j && j != k && i != k) && i + j + k == b) count++;
                        }
                    }
                }

                Console.WriteLine(count);
            }
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:8:26: error: 'string' has not been declared
    8 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:8:35: error: expected ',' or '...' before 'args'
    8 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:33:6: error: expected ';' after class definition
   33 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void _10017::Program::Main(int*)':
a.cc:12:17: error: 'string' was not declared in this scope
   12 |                 string[] readline = Console.ReadLine().Split(' ');
      |                 ^~~~~~
a.cc:12:24: error: expected primary-expression before ']' token
   12 |                 string[] readline = Console.ReadLine().Split(' ');
      |                        ^
a.cc:13:25: error: expected primary-expression before 'int'
   13 |                 int a = int.Parse(readline[0]);
      |                         ^~~
a.cc:14:25: error: expected primary-expression before 'int'
   14 |                 int b = int.Parse(readline[1]);
      |                         ^~~
a.cc:30:17: error: 'Console' was not declared in this scope
   30 |                 Console.WriteLine(count);
      |                 ^~~~~~~
Language: C++

//
//  aoj_10017.cpp
//  
//
//  Created by aiba1994 on 2016/05/29.
//
//
/*How many ways?
 1 ?????? n ?????§?????°?????????????????????????????§???????????°?????????????????????????¨???? x ??¨??????????????????????????°????±???????????????°?????????????????????????????????
 ????????°???1 ?????? 5 ?????§?????°???????????????????????§????????????????¨???? 9 ??¨???????????????????????????
 1 + 3 + 5 = 9
 2 + 3 + 4 = 9
 ??????????????????????????????*/

#include <stdio.h>
int main(){
    /*int i, j, k;
    int n, x;
    int count;
    
    while(1){
        scanf("%d %d ", &n, &x);
        if(n==0&&x==0)break;
        count=0;
        for(i=1;3*i+3<=x;i++){
            for(j=i+1;i+2*j+1<=x;j++){
                for(k=n;k>j;k--){
                    if(x==i+j+k){
                        count++;
                        break;
                    }else if(x>=i+j+k){
                        break;
                    }
                }
            }
        }
        printf("%d\n", count);
    }*/
    int n; //1??????n?????§?????°
    int x; //????¨?
    int number_of_combinations;
    int i,j,k;
    
    while (1) {
        scanf("%d %d", &n, &x);
        if(n == 0 && x == 0){
            break;
        }
        
        number_of_combinations = 0;
        
        for (i=1; 3*(i+3) <=x; i++) {
            for (j=i+1; i+2*j+1<=x; j++) {
                for (k=n; k>j; k--) {
                    if((i+j+k) == x){
                        number_of_combinations += 1;
                        break;
                    }
                    else if((i+j+k) >= x){
                        break;
                    }
                }
            }
        }
        printf("%d\n", number_of_combinations)
        
    }
    
    
    /*Input
     ?????°??????????????????????????\?????¨??????????????????????????????????????????????????§??????????????§??????????????? n???x ??? 1 ???????????????????????????
     n???x ?????¨?????? 0 ?????¨?????\?????????????????¨????????????
     n ??? 3 ??\??? 100?????\?????¨????????????*/
    /*Output
     ????????????????????????????????????????????????????????°????????????????????????????????????*/
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:47: error: expected ';' before '}' token
   65 |         printf("%d\n", number_of_combinations)
      |                                               ^
      |                                               ;
   66 | 
   67 |     }
      |     ~
Language: C++

while true
	input = gets.split(" ")
	n = input[0].to_i
	x = input[1].to_i
	count = 0
	break if n == 0 && x == 0
	1.upto(n) do |i|
		(i + 1).upto(n) do |j|
			(j + 1).upto(n) do |k|
				if i + j + k == x then count += 1
				end
			end
		end
	end
	puts count
end

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while true
      | ^~~~~
Language: C++

#include<iostream>
using namespace std;
bool x[100][100][100] = {false};

int loop(int n, int x){
	int i, j, k, cou = 0;
	
	for(i = 1; i <= n; i++){
		for(j = 1; j <= n; j++){
			for(k = 1; k <= n; k++){
				if(x[i][j][k] == true) ; 
				else{
					if((i + j + k) == x){
						cou += 1;
						x[i][j][k] = true;
						x[i][k][j] = true;
						x[j][i][k] = true;
						x[j][k][i] = true;
						x[k][i][j] = true;
						x[k][j][i] = true;
					}
				}
			}
		}
	}
	
	return cou;
}

int main(void){
	int mn, mx;
	
	while(1){
		cin >>mn >>mx;
		if(mn == 0 && mx == 0) break;
		cout <<loop(mn, mx)<<endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int loop(int, int)':
a.cc:11:37: error: invalid types 'int[int]' for array subscript
   11 |                                 if(x[i][j][k] == true) ;
      |                                     ^
a.cc:15:50: error: invalid types 'int[int]' for array subscript
   15 |                                                 x[i][j][k] = true;
      |                                                  ^
a.cc:16:50: error: invalid types 'int[int]' for array subscript
   16 |                                                 x[i][k][j] = true;
      |                                                  ^
a.cc:17:50: error: invalid types 'int[int]' for array subscript
   17 |                                                 x[j][i][k] = true;
      |                                                  ^
a.cc:18:50: error: invalid types 'int[int]' for array subscript
   18 |                                                 x[j][k][i] = true;
      |                                                  ^
a.cc:19:50: error: invalid types 'int[int]' for array subscript
   19 |                                                 x[k][i][j] = true;
      |                                                  ^
a.cc:20:50: error: invalid types 'int[int]' for array subscript
   20 |                                                 x[k][j][i] = true;
      |                                                  ^
Language: C++

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

int loop(int n, int x){
	bool io[100][100][100] = {false};
	int i, j, k, cou = 0;
	
	for(i = 1; i <= n; i++){
		for(j = 1; j <= n; j++){
			for(k = 1; k <= n; k++){
				if(io[i][j][k] == true || i == j || i == k || j == k) ; 
				else{
					if((i + j + k) == x){
						cou += 1;
						io[i][j][k] = true;
						io[i][k][j] = true;
						io[j][i][k] = true;
						io[j][k][i] = true;
						io[k][i][j] = true;
						io[k][j][i] = true;
					}
				}
			}
		}
	}
	
	return cou;
}

int main(void){
	int mn, mx;
	
	while(1){
		cin >>mn >>mx;
		if(mn == 0 && mx == 0) break;
		cout <<loop(mn, mx)<<endl;
	}
	
	return 0;
}

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

#include <iostream>

using namespace std;

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

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

#include <iostream>
using namespace std;

int main(){
  int n, x;

  while(true){
    cin >> n;
    cin >> x;
    if((n|x) == 0) break;
&#160; int count=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) count++;
	}
      }
    }

    cout << count << endl;

  }
  return 0;
}

Compiler output:
a.cc:11:2: error: stray '#' in program
   11 | &#160; int count=0;
      |  ^
a.cc: In function 'int main()':
a.cc:11:3: error: lvalue required as unary '&' operand
   11 | &#160; int count=0;
      |   ^~~
Language: C++

#include<stdio.h>
int main(void)
{
	int x=0,n=0;
	int i=0,j=0,z=0;
	int count=0;
	int flg=0;
	int hazusi[1000]={0},hazusi2[1000]={0},hazusi3[1000]={0};
	int count2=0;
	int mawasu=0;
	while(scanf("%d %d",&n,&x))
	{
		if (n==0&&x==0)
		{
			break;
		}
		count=0;
		count2=0;
		for (i=1;i<=n;i++)
		{
			for (j=1;j<=n;j++)
			{
				for (z=1;z<=n;z++)
				{
					if (i+j+z==x)
					{
						if (i==j||i==z||j==z)
						{
							continue;
						}
						else
						{
							flg=0;
							for (mawasu=0;mawasu<count2;mawasu++)
							{
								if (hazusi[mawasu]==i&&(hazusi2[mawasu]==j||hazusi2[mawasu]==z)&&(hazusi3[mawasu]==j||hazusi3[mawasu]==z))
								{
									flg=1;
								}
								else if (hazusi[mawasu]==j&&(hazusi2[mawasu]==i||hazusi2[mawasu]==z)&&(hazusi3[mawasu]==i||hazusi3[mawasu]==z))
								{
									flg=1;
								}
								else if (hazusi[mawasu]==z&&(hazusi2[mawasu]==i||hazusi2[mawasu]==j)&&(hazusi3[mawasu]==i||hazusi3[mawasu]==j))
								{
									flg=1;
								}
							}
							if (flg==0)
							{
								count++;
								hazusi[count2]=i;
								hazusi2[count2]=j;
								hazusi3[count2]=z;
								count2++;
							}
						}
					}
				}
			}
		}
		printf("%d\n",count);
	}
	return 0;

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

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: 'jk' was not declared in this scope; did you mean 'k'?
   10 | for(int k=j+1;jk<=n;k++){
      |               ^~
      |               k
Language: C++

#include<studio.h>

int main()
{
   int a,b,c,n,x,z=0;
   while(1){
   scanf("%d %d",&n,&x);
   if(n==0&&x==0)  break;
   for(a=0;a<n;a++){
      for(b=0;b<n;b++){
         for(c=0;c<n;c++){
            if(a+b+c==x) z++;
         }
      }
   }
   printf("%d",z);
   }
   return 0;
}
   

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

#include<iostream>
#include<boost/format.hpp>

//O(n^2)でもできるはず
//i,jを決めてしまえば自然とkも決まる
int CountCombination(int n, int x){
	int res = 0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			int k = x-(i+j);
			if(i != j
				 && i != k
				 && j != k
				 && k > 0
				 && k <= n){
				//i,j,kに重複がないようにする。条件よりkは(0,n]
				res++;
			}
		}
	}
	
	//(a,b,c), (a,c,b), (b,a,c), (b,c,a), (c,a,b), (c,b,a)を重複して数えているので6で割る
	return res/6;
}

int main(){
	int n, x;
	while(std::cin >> n >> x, n){
		std::cout << CountCombination(n, x) << std::endl;
	}
	return 0;
}

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

while True:
    n, x = [int(i) for i in raw_input().split()]
    if(n == 0 and x == 0):
        break
    count = 0
    for i in range(1, 1 + n):
        for j in range(i, 1 + n):
            for k in range(j, 1 + n):
                if(i != j and j != k and i != k):
                    if (i + j + k) == x:
                        count += 1
    print count

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while True:
      | ^~~~~
Language: C++

#include<iostream>
using namespace std;

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

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

#include<iostream>
using namespace std;

int main()
{
 int x,y,count=0;
 cin>>x>>y;
 cin.ignore();
 if(x!=0||!=0)
 for(int i=1; i<=x-2; i++)
 {
  for(int j=1; j<=x-1;j++)
  {
   for(int k=1; k<=x; k++)
   {
    if(i+j+k==x) 
    count++;
    }
   }
  }
 cout<<count<<endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected primary-expression before '!=' token
    9 |  if(x!=0||!=0)
      |           ^~
Language: C++

#include <iostream>
using namespace std;

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

		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;
}

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

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


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

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

using namespace std;

int main()
{
    int ways = 0;
    int n, x, i, j, k;
    for (;;) {
	cin >> n >> x;
	if (n == 0 && x == 0)
	    return 0;
	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)
			++ways;
		}
	    }
	}
	cout << ways << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> n >> x;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << ways << endl;
      |         ^~~~
a.cc:19:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:25: error: 'endl' was not declared in this scope
   19 |         cout << ways << endl;
      |                         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

int main()
{
    int n, x;
    int ans = 0;

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

            if(i + j + k == x)
                ans++;
        }
        cout << ans / n << endl;
        ans = 0;
    }
    return EXIT_SUCCESS;

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

#include <cstdio>
using namespace std;

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

Compiler output:
a.cc:13:35: warning: missing terminating " character
   13 |                 printf("%d\n", ans");
      |                                   ^
a.cc:13:35: error: missing terminating " character
   13 |                 printf("%d\n", ans");
      |                                   ^~~
a.cc: In function 'int main()':
a.cc:13:35: error: expected ')' before '}' token
   13 |                 printf("%d\n", ans");
      |                       ~           ^
      |                                   )
   14 |         }
      |         ~
Language: C++

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int z=0;
		while(true){
			int x=sc.nextInt();
			int y=sc.nextInt();
			if(x==0 && y==0)break;
			for(int i=1;i<x+1;i++){
				for(int j=1;j<x+1;j++){
					for(int k=1;k<x+1;k++){
						if(y==(i+k+j)&& i>j && j>k){
							z++;
						}
					}
				}
			}
			System.out.printf("%d\n",z);
			z=0;
		}
	}
}

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

#include <iostream>
using namespace std;

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

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

#include <stdio.h>

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

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

import java.util.Scanner;

public class Main{
public static void main(String[] args){
	int x,y,i,j;
	Scanner sc = new Scanner(System.in);
	while(true){
		x=sc.nextInt();
		y=sc.nextInt();
		if(x==0&&y==0){
			break;
		}
		for(i=0;i<x;i++){
			for(j=0;j<y;j++){
				if(i=0||i=x-1||j=0||j=y-1){
					System.out.printf("#");
				}else{
					System.out.printf(".");
				}
			}
			System.out.printf("\n");
		}
	}


}
}

Compiler output:
Main.java:15: error: bad operand types for binary operator '||'
				if(i=0||i=x-1||j=0||j=y-1){
				      ^
  first type:  int
  second type: int
Main.java:15: error: bad operand types for binary operator '||'
				if(i=0||i=x-1||j=0||j=y-1){
				             ^
  first type:  int
  second type: int
Main.java:15: error: bad operand types for binary operator '||'
				if(i=0||i=x-1||j=0||j=y-1){
				                  ^
  first type:  int
  second type: int
Main.java:15: error: incompatible types: int cannot be converted to boolean
				if(i=0||i=x-1||j=0||j=y-1){
				    ^
4 errors
Language: Java


import java.util.Scanner;
 
public class Main{
public static void main(String[] args){
    int x,y,i,j;
    Scanner sc = new Scanner(System.in);
    while(true){
        x=sc.nextInt();
        y=sc.nextInt();
        if(x==0&&y==0){
            break;
        }
        for(i=0;i<x;i++){
            for(j=0;j<y;j++){
                if(i=0||i=x-1||j=0||j=y-1){
			System.out.printf("#");
		}else{
			System.out.printf(".");
		}
            }
            System.out.printf("\n");
        }
        System.out.printf("\n");
    }
 
}
}

Compiler output:
Main.java:16: error: bad operand types for binary operator '||'
                if(i=0||i=x-1||j=0||j=y-1){
                      ^
  first type:  int
  second type: int
Main.java:16: error: bad operand types for binary operator '||'
                if(i=0||i=x-1||j=0||j=y-1){
                             ^
  first type:  int
  second type: int
Main.java:16: error: bad operand types for binary operator '||'
                if(i=0||i=x-1||j=0||j=y-1){
                                  ^
  first type:  int
  second type: int
Main.java:16: error: incompatible types: int cannot be converted to boolean
                if(i=0||i=x-1||j=0||j=y-1){
                    ^
4 errors
Language: Java

import java.util.Scanner;

public class F0413{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    while(true){
      int H = sc.nextInt();
      int W = sc.nextInt();
      if(H==0 && W==0){
        break;
      }else{
        for(int i=0;i<W;i++){
            System.out.printf("#");
        }
        System.out.printf("\n");
        for(int j=1;j<H-1;j++){
          System.out.printf("#");
          for(int i=1;i<W-1;i++){
            System.out.printf(".");
          }
          System.out.printf("#\n");
        }
        for(int i=0;i<W;i++){
          System.out.printf("#");
        }
        System.out.printf("\n\n");
      }
    }
  }
}

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

import java.util.Scanner;
import java.util.ArrayList;

public class test{
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	while (true){
	int a = sc.nextInt();
	int b = sc.nextInt();
	int i,j;
	if (a==0 && b==0){
		break;
		}
	for(i=0;i<a; i++){
		if (i==0){
		for(j=0;j<b;j++){
			System.out.printf("#");
			}
			}else{
			System.out.printf("\n");
			for(i=1;i<a-1;i++){
			System.out.printf("#");
					for(j=1;j<b-1;j++){
					System.out.printf(".");
					}
				System.out.printf("#\n");
				}
		    for(j=0;j<b;j++){
			System.out.printf("#");
			}
	System.out.printf("\n");
	}
	}
}
}
}

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

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h, w, i, j;
		while (true) {
			h = sc.nextInt();
			w = sc.nextInt();
			if (h == 0 && w == 0) break;
			else {
				for (i = 0; i < w; i ++) System.out.print("#");
				System.out.print("\n");
				for (j = 1; j < h - 1; j ++) {
					System.out.print("#");
					for (i = 1; i < w - 1; i ++) System.out.print(".");
					System.out.println("#");
				}
				for (i = 0; i < w; i ++) System.out.print("#");
				System.out.print("\n\n");
			}
		}
	}
}import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h, w, i, j;
		while (true) {
			h = sc.nextInt();
			w = sc.nextInt();
			if (h == 0 && w == 0) break;
			else {
				for (i = 0; i < w; i ++) System.out.print("#");
				System.out.print("\n");
				for (j = 1; j < h - 1; j ++) {
					System.out.print("#");
					for (i = 1; i < w - 1; i ++) System.out.print(".");
					System.out.println("#");
				}
				for (i = 0; i < w; i ++) System.out.print("#");
				System.out.print("\n\n");
			}
		}
	}
}

Compiler output:
Main.java:23: error: class, interface, enum, or record expected
}import java.util.Scanner;
 ^
1 error
Language: Java

import java.util.Scanner;
public clas Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int c = 0;
		while(c==0){
			int H = sc.nextInt();
			int W = sc.nextInt();
			if(H==0 && W==0){
				break;
			}
			for(int i=0;i<H;i++){
				for(int s=0; s<W;s++){
					System.out.printf("#");
				}
				System.out.printf("\n");
			}
		}


	}
}

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

mport java.util.Scanner;

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

loop:
    while(true) {
      int h = sc.nextInt();
      int w = sc.nextInt();

      if(w == 0 && h == 0) {
        break loop;
      }

      for(int i = 1; i <= h; i++) {
        for(int j = 1; j <= w; j++) {
          if(i == 1 || i == h || j == 1 || j == w) {
            System.out.print("#");
          } else {
            System.out.print(".");
          }
        }
        System.out.print("\n");
      }
      System.out.print("\n");
    }
  }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

import java.util.Scanner;
 
public class Main{
    public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	int i=1;
	
    while(true){
        int x = sc.nextInt();
        int y = sc.nextInt();
        if(x==0 && y==0) break;
	while(true){
	    if(i==1 || i==x){
		for(int j=1; j<=y; j++){
		    System.out.printf("#");
		}
	    }else{
		System.out.printf("#");
		for(int j=1; j<=y-2; j++){
		    System.out.printf(" ");
		}
		System.out.printf("#");
	    }
	    i++;
	}
	
	    
        System.out.printf("\n");
    }
    }
}
 

Compiler output:
Main.java:28: error: unreachable statement
        System.out.printf("\n");
        ^
1 error
Language: Java

import java.util.Scanner;
 
public class Main{
    public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	int i=1;
	
    while(true){
        int x = sc.nextInt();
        int y = sc.nextInt();
        if(x==0 && y==0) break;
	while(true){
	    if(i==1){
		for(int j=1; j<=y; j++){
		    System.out.printf("#");
		}
	    }else{
		System.out.printf("#");
		for(int j=1; j<=y-2; j++){
		    System.out.printf(" ");
		}
		System.out.printf("#");
	    }else if(i==y){
		for(int j=1; j<=y; j++){
		    System.out.printf("#");
		}
		break;
	    }
	    i++;
	}
	
	    
        System.out.printf("\n");
    }
    }
}
 
	

Compiler output:
Main.java:23: error: 'else' without 'if'
	    }else if(i==y){
	     ^
1 error
Language: Java

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

while (true) {

int H = sc.nextInt();

int W= sc.nextInt();

if (H == 0 && W == 0) {

break;

}
for(int j=0;j<W;j++){
		System.out.print("#");
		}
System.out.printf("\n");
	}
for(int i=1;i<H-1;i++){
	System.out.print("#")
	for(int j=1;j<W-1;j++){
		System.out.print(".");
		}
System.out.printf("#\n");
	}
	for(int j=0;j<W;j++){
		System.out.print("#");
		}
System.out.printf("\n");
}

}
}

Compiler output:
Main.java:26: error: ';' expected
	System.out.print("#")
	                     ^
Main.java:39: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

while (true) {

int H = sc.nextInt();

int W= sc.nextInt();

if (H == 0 && W == 0) {

break;

}
for(int j=0;j<W;j++){
		System.out.print("#");
		}
System.out.printf("\n");
	}
for(int i=1;i<H-1;i++){
	System.out.print("#");
	for(int j=1;j<W-1;j++){
		System.out.print(".");
		}
System.out.printf("#\n");
	}
	for(int j=0;j<W;j++){
		System.out.print("#");
		}
System.out.printf("\n");
}

}
}
}

Compiler output:
Main.java:39: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.Scanner;

class Main
{
	public static void main(String args[])
	{
		int flag = 1;
		Scanner scan= new Scanner(System.in);
		while(flag > 0)
		{
		int H = scan.nextInt();
		int W = scan.nextInt();
		if(H == 0 && W == 0)
		{
			break;
		}

		for(int i=0; i<H; i++)
		{
			for(int j=0; j<W; j++)
			{
				if(j==0 || j==W-1 || i=0 || i==H-1)
					System.out.print("#");
				else
					System.out.print(".");
			}

				System.out.println();
		}
		System.out.println();
		}

	}
}

Compiler output:
Main.java:22: error: bad operand types for binary operator '||'
				if(j==0 || j==W-1 || i=0 || i==H-1)
				                  ^
  first type:  boolean
  second type: int
Main.java:22: error: bad operand types for binary operator '||'
				if(j==0 || j==W-1 || i=0 || i==H-1)
				                         ^
  first type:  int
  second type: boolean
2 errors
Language: Java

import java.util.Scanner;

public class PF{
 public static void main(String[] args){
  
  /*sc:for scan from keyboard ; H,W:for rectangle's height & width*/
  Scanner sc=new Scanner(System.in);
  int[] H =new int[100000];
  int[] W =new int[100000];
  
  /*Default value of data-set(H,W) No.*/
  int i=0;
 
  /*Use do-while because the 1st data-set must scan*/
  do{
    H[i]=sc.nextInt();
    W[i]=sc.nextInt();
    i++;
  }while(H[i-1]!=0||W[i-1]!=0)  //Repeat until the last data-set (H,W)=(0,0)

  for(int m=0;m<i-1;m++){
   int k,l;
   for(k=0;k<H[m];k++){
    for(l=0;l<W[m];l++){
     if(k==0||k==H[m]-1||l==0||l==W[m]-1)  //when k or l is at edge -> frame
      System.out.printf("#");  //expression frames
     else
      System.out.printf(".");  //expression the inner of frames
   }
   System.out.printf("\n");    //New line for expression rectangle's width
   }
  System.out.printf("\n");     //New line for interval between 2 rectangles
  }
 }
}

Compiler output:
Main.java:19: error: ';' expected
  }while(H[i-1]!=0||W[i-1]!=0)  //Repeat until the last data-set (H,W)=(0,0)
                              ^
1 error
Language: Java

import java.util.Scanner;
 
public class Main_10013{
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    while(true){
        int H = sc.nextInt();
        int W = sc.nextInt();
        if(H == 0 && W == 0) {
        	break;
        }
        for(int i=0;i<H;i++){
        	if(i==0 || i==H-1){ 
        		for(int j=0;j<W;j++){
        			System.out.printf("#");
        		}
        	}else {
            for(int j=0;j<W;j++){
            	if(j==0 || j==W-1){
            		System.out.printf("#");
            	}else{
            		System.out.printf(".");
            }
             
        }
        System.out.printf("\n");
        }
        System.out.printf("\n");
    }
    }
    }
}

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

import java.util.Scanner;

public class Main2to6 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			for (int i = 0; i < W; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n");
			for (int i = 0; i < (H - 2); i++) {
				System.out.printf("#");
				for (int j = 0; j < (W - 2); j++) {
					System.out.printf(" ");
				}
				System.out.printf("#");
				System.out.printf("\n");
			}
			for (int i = 0; i < W; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n\n");
		}
		sc.close();
	}
}

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

import java.util.Scanner;

public class Main2to6 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			for (int i = 0; i < W; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n");
			for (int i = 0; i < (H - 2); i++) {
				System.out.printf("#");
				for (int j = 0; j < (W - 2); j++) {
					System.out.printf(" ");
				}
				System.out.printf("#");
				System.out.printf("\n");
			}
			for (int i = 0; i < W; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n");
		}
		sc.close();
	}
}

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

import java.util.Scanner;

public class Main_10013 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			for (int i = 0; i < H; i++) {
				if (i == 0 || i == H - 1) {
					for (int j = 0; j < W; j++) {
						System.out.printf("#");
					}
					System.out.printf("\n");
				} else {
					for (int j = 0; j < W; j++) {
						if (j == 0 || j == W - 1) {
							System.out.printf("#");
						} else {
							System.out.printf(".");
						}
					}
					System.out.printf("\n");
				}
				System.out.printf("\n");
			}
		}
	}
}

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

import java.util.Scanner;

public class Main_10013 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if (H == 0 && W == 0) {
				break;
			}
			for (int i = 0; i < H; i++) {
				if (i == 0 || i == H - 1) {
					for (int j = 0; j < W; j++) {
						System.out.printf("#");
					}
				} else {
					for (int j = 0; j < W; j++) {
						if (j == 0 || j == W - 1) {
							System.out.printf("#");
						} else {
							System.out.printf(".");
						}
					}
				}
				System.out.printf("\n");
			}
			System.out.printf("\n");
		}
	}
}

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

import java.util.Scanner;
public class Frame {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(true){
		
		int H=sc.nextInt();
		int W=sc.nextInt();
		if(H==0 && W==0){
			break;
		}
		
		for(int i=0;i<W;i++){
			System.out.printf("#");
		}
		System.out.printf("\n");
					
		for(int i=0;i<H-2;i++){
			System.out.printf("#");
			for(int j=0;j<W-2;j++){
				System.out.printf(".");
			}
			System.out.printf("#");
		}
		System.out.printf("\n");
		}
		
		for(int i=0;i<W;i++){
			System.out.printf("#");
		}
		System.out.printf("\n");
			
		}
	}
	

Compiler output:
Main.java:2: error: class Frame is public, should be declared in a file named Frame.java
public class Frame {
       ^
Main.java:28: error: cannot find symbol
		for(int i=0;i<W;i++){
		              ^
  symbol:   variable W
  location: class Frame
2 errors
Language: Java

import java.util.Scanner;
public class Rectangle {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(true){
		
		int H=sc.nextInt();
		int W=sc.nextInt();
		if(H==0 && W==0){
			break;
		}
			for(int i=0;i<H;i++){
				if(i==0||i==H-1){
					for(int j=0;j<W;j++){
						System.out.printf("#");
					}
					System.out.printf("\n");
				}else{
					System.out.printf("#");
					for(int k=0;k<W-2;k++){
						System.out.printf(".");
					}
					System.out.printf("#");
				}
				System.out.printf("\n");
				}
			System.out.printf("\n");
		}
	}
	}
	

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

import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(true){
		
		int H=sc.nextInt();
		int W=sc.nextInt();
		if(H==0 && W==0){
			break;
		}
		
		for(int i=0;i<W;i++){
			System.out.printf("#");
		}
		System.out.printf("\n");
					
		for(int i=0;i<H-2;i++){
			System.out.printf("#");
			for(int j=0;j<W-2;j++){
				System.out.printf(".");
			}
			System.out.printf("#");
		}
		System.out.printf("\n");
		}
		
		for(int i=0;i<W;i++){
			System.out.printf("#");
		}
		System.out.printf("\n");
			
		}
	}
	

Compiler output:
Main.java:28: error: cannot find symbol
		for(int i=0;i<W;i++){
		              ^
  symbol:   variable W
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if ( H == 0 && W == 0 ) break;
			for(int i = 0 ; i < W ; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n");
			for (int i = 0 ; i < H-2 ; i++) {
				System.out.printf("#");
				for (int j = 0 ; j < W-2 ; j++) {
					System.out.printf(".");
				}
				System.out.println("#");
			}
			for(int i = 0 ; i < W ; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n\n");
		}
	}
}

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

import java.util.Scanner;

public class Main
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if ( H == 0 || W == 0 ) break;
			for(int i = 0 ; i < W ; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n");
			for (int i = 0 ; i < H-2 ; i++) {
				System.out.printf("#");
				for (int j = 0 ; j < W-2 ; j++) {
					System.out.printf(".");
				}
				System.out.println("#");
			}
			for(int i = 0 ; i < W ; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n\n");
		}
	}
}

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

import java.util.Scanner;

public class Frame {
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		while(true) {
			int H = sc.nextInt();
			int W = sc.nextInt();
			if ( H == 0 || W == 0 ) break;
			for(int i = 0 ; i < W ; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n");
			for (int i = 0 ; i < H-2 ; i++) {
				System.out.printf("#");
				for (int j = 0 ; j < W-2 ; j++) {
					System.out.printf(".");
				}
				System.out.println("#");
			}
			for(int i = 0 ; i < W ; i++) {
				System.out.printf("#");
			}
			System.out.printf("\n\n");
		}
	}
}

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

import java.util.Scanner;
public class Rectangle {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(true){
		int H=sc.nextInt();
		int W=sc.nextInt();
		if(H==0 && W==0){
			break;
		}
			for(int i=0;i<H;i++){
				if(i==0||i==H-1){
					for(int j=0;j<W;j++){
						System.out.printf("#");
					}
					System.out.printf("\n");
					
				}else{
					System.out.printf("#");
					for(int k=0;k<W-2;k++){
						System.out.printf(".");
					}
					System.out.printf("#");
					System.out.printf("\n");
				}
			}
			System.out.printf("\n");
		}
	}
}

Compiler output:
Main.java:2: error: class Rectangle is public, should be declared in a file named Rectangle.java
public class Rectangle {
       ^
1 error