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

#include <iostream>
using namespace std;
int main(){
        int c1,c5,c10,c50,c100,c500;
        cin>>c1>>c5>>c10>>c50>>c100>>c500;
        if(c1*1+c5*5+c10*10+c50*50+c100*100+c500*500>=1000){
                cout<<"1"<<endl;
        }
        else{
                cout<<"0"<<endl;
        }
        return 0;

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

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define omajinai ios::sync_with_stdio(false);cin.tie(0)
#define rep(i,x) for(int i=0;i<(int)(x);++i)
#define rep1(i,x) for(int i=1;i<=(int)(x);++i)

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;}
template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;}
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T get(){T a;cin>>a;return a;}
template<typename T>T rev(T a){reverse(all(a));return a;}
template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}

const int inf = 1e9;
const ll linf = 3e18;
const double eps = 1e-9;

signed main()
{
    int a[5];
    int s = 0;
    rep(i, 5) cin >> a[i], s += a[i];
    cout << (a >= 1000) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   55 |     cout << (a >= 1000) << endl;
      |              ~~^~~~~~~
Language: C++

#include<stdio.h>
int main(void)
{
    int c1,c5,c10,c50,c100,c500,sum;
	scanf("%d %d %d %d %d %d",&c1,&c5,&c10,&c50,&c100,&c500);
	sum=c1*1+c5*5+c10*10+c50*50+c100*100+c500*500;
	if("1000<sum"){
	  printf("1\n");
	}
	else if{
	    printf("0\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected '(' before '{' token
   10 |         else if{
      |                ^
      |                (
Language: C++

#include<stdio.h>
int main(void)
{
    int c1,c5,c10,c50,c100,c500,sum;
	scanf("%d %d %d %d %d %d",&c1,&c5,&c10,&c50,&c100,&c500);
	sum=c1*1+c5*5+c10*10+c50*50+c100*100+c500*500;
	if("1000<sum"){
	  printf("1\n");
	}
	else("1000>sum"){
	    printf("0\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: expected ';' before '{' token
   10 |         else("1000>sum"){
      |                         ^
      |                         ;
Language: C++

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

int c1,c5,c10,c50,c100,c500;
int all = 0;

int main() {
  cin >> c1 >> c5 >> c10 >> c50 >> c100 >> c500;
  all = c1*1+c5*5+c10*10+c50*50+c100*100+c500*500
  if( all => 1000) {
    cout << 1 << endl;
  }else {
    cout << 0 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:50: error: expected ';' before 'if'
    9 |   all = c1*1+c5*5+c10*10+c50*50+c100*100+c500*500
      |                                                  ^
      |                                                  ;
   10 |   if( all => 1000) {
      |   ~~                                              
a.cc:12:4: error: 'else' without a previous 'if'
   12 |   }else {
      |    ^~~~
Language: C++

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

int c1,c5,c10,c50,c100,c500;
int all = 0;

int main() {
  cin >> c1 >> c5 >> c10 >> c50 >> c100 >> c500;
  all = c1*1+c5*5+c10*10+c50*50+c100*100+c500*500;
  if( all => 1000) {
    cout << 1 << endl;
  }else {
    cout << 0 << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: expected primary-expression before '>' token
   10 |   if( all => 1000) {
      |            ^
Language: C++

#include<iostream>
using namespace std;

int main(){

int c1,c5,c10,c50,c100,c500,num;

cin>>c1>>c5>>c10>>c50>>c100>>c500;

num=c1*1+c5*5+c10*10+c50*50+c100*100+c500*500;

if(num%1000=0){
cout<<"0"<<"\n";
}else{
cout<<"1"<<"\n";
}

return 0;
}

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

#include<iostream>
#include<algorithm>
#include<string>

using namespace std;

int main()
{
	int table[6]={1,5,10,50,100,500};
	int ans=0:
	for(int i=0;i<6;i++)
	{
		int data;
		cin>>data;
		ans+=data*table[i];
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ',' or ';' before ':' token
   10 |         int ans=0:
      |                  ^
a.cc:11:21: error: 'i' was not declared in this scope
   11 |         for(int i=0;i<6;i++)
      |                     ^
Language: C++

#include<stdio.h>
 
int main(void){
 
    int c[6]={1,5,10,50,100,500};
    int a[6];
    int b=0;
    int i;
 
    for(i=0;i<6;i++){
        scanf("%d",&a[i]);
        b=b+a[i]*c[i];
    }
 
    printf("\n");
    if(b=>1000)
      printf("1\n");
    else
      printf("0\n");
     
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:10: error: expected primary-expression before '>' token
   16 |     if(b=>1000)
      |          ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
	int c1,c2,c3,c4,c5,c6;
	cin >> c1;
	cin >> c2;
	cin >> c3;
	cin >> c4;
	cin >> c5;
	cin >> c6;
	if(c1+(c2*5)+(c3*10)+(c4*50)+(c5*100)+(c6*500) >= 1000)
		cout<<"1"<<endl;;
	else
		cout<<"0"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'else' without a previous 'if'
   14 |         else
      |         ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include <string>
using namespace std;
int main()
{
	#include<iostream>
using namespace std;
int main()
{
    int c1,c2,c3,c4,c5,c6;
    cin >> c1;
    cin >> c2;
    cin >> c3;
    cin >> c4;
    cin >> c5;
    cin >> c6;
    if(c1+(c2*5)+(c3*10)+(c4*50)+(c5*100)+(c6*500) >= 1000)
        cout<<"1"<<endl;
    else
        cout<<"0"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   10 | int main()
      |         ^~
a.cc:10:9: note: remove parentheses to default-initialize a variable
   10 | int main()
      |         ^~
      |         --
a.cc:10:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:11:1: error: a function-definition is not allowed here before '{' token
   11 | {
      | ^
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int a, b, c, d, e, f;
	cin >> a >> b >> c >> d >> e >> f;
	int sum = a+b*5+c*10+d*50+e*100+f*500;
	if(sum > 1000) cout << 1;
	else cout << 0;3 1 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:25: error: expected ';' before numeric constant
    9 |         else cout << 0;3 1
      |                         ^~
      |                         ;
Language: C++

using namespace std;

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

	int c1, c5, c10, c50, c100, c500;
	cin >> c1 >> c5 >> c10 >> c50 >> c100 >> c500;
	int ans = 0;
	c5 += c1 / 5;
	c10 += c5 / 2;
	c50 += c10 / 5;
	c100 += c50 / 2;
	c500 += c100 / 5;
	ans = c500 / 2;
	cout << ans << endl;

	return 0;
}
Add Comment

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin.tie(0);
      |         ^~~
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:5:9: error: 'ios' has not been declared
    5 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout << ans << endl;
      |         ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:24: error: 'endl' was not declared in this scope
   16 |         cout << ans << 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;
a.cc: At global scope:
a.cc:20:1: error: 'Add' does not name a type
   20 | Add Comment
      | ^~~
Language: C++

#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <functional>
#include <sys/timeb.h>
#include <fstream>
using namespace std;

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

	int c1, c5, c10, c50, c100, c500;
	cin >> c1 >> c5 >> c10 >> c50 >> c100 >> c500;
	int ans = 0;
	c5 += c1 / 5;
	c10 += c5 / 2;
	c50 += c10 / 5;
	c100 += c50 / 2;
	c500 += c100 / 5;
	ans = c500 / 2;
	cout << ans << endl;

	return 0;
}
Add Comment

Compiler output:
a.cc:28:1: error: 'Add' does not name a type
   28 | Add Comment
      | ^~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<math.h>
#inlcude<algorithm>
using namespace std;
int main()
{
	int g,c1,c5,c10,c50,c100,c500;
	cin>>c1>>c5>>c10>>c50>>c100>>c500;
	g=c1+c5*5+c10*10+c50*50+c100*100+c500*500;
	if(g>=1000)
		cout<<"1"<<endl;
	else
		cout<<"0"<<endl;
	return 0;
}


Compiler output:
a.cc:4:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    4 | #inlcude<algorithm>
      |  ^~~~~~~
      |  include
Language: C++

#include <stdio.h>

int main(void) {
  int c, d[6] = {1, 5, 10, 50, 100, 500}, i, ans = 0;
  for(i = 0; i < n; ++i) {
    scanf("%d", &c);
    ans += c * d[i];
  }
  if(ans >= 1000)printf("0\n");
  else printf("1\n");
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e>>f;
  int sum=a+b*5+c*10+d*50+e*100+f*500;
  if(sum>=1000){cout<<1<<endl}
  else{cout<<0<<endl}

}




Compiler output:
a.cc: In function 'int main()':
a.cc:7:30: error: expected ';' before '}' token
    7 |   if(sum>=1000){cout<<1<<endl}
      |                              ^
      |                              ;
a.cc:8:21: error: expected ';' before '}' token
    8 |   else{cout<<0<<endl}
      |                     ^
      |                     ;
Language: C

#include<stdio.h>

main()
{
	int N,K,P,cou;
	
	scanf("%d",&N);
	
	for(cou=1;cou<=N;cou++){
		scanf("%d %d",&K.&P);
		
		while(K>0){
			for(cou=1;cou<=K;cou++){
				k--;
				if(K==0){
					break;
				}
			}
		}
		printf("%d\n",cou);
	}
	
	return 0;
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:10:34: error: expected identifier before '&' token
   10 |                 scanf("%d %d",&K.&P);
      |                                  ^
main.c:14:33: error: 'k' undeclared (first use in this function)
   14 |                                 k--;
      |                                 ^
main.c:14:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void){
	int N,K,P,a;
	scanf("%d",&N);
	for(a=1; a<=N; a++){
		scanf("%d %d",&K,&P);
		if(P%2==0 K%P==0 && K!=P)
		printf("2\n");
		else if(P%2==0 && K%P==0 && K==P)
		printf("1\n");
		else if(P%2==1 && K%P==0)
		printf("3\n");
		else
		printf("%d\n",K%P);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:26: error: expected ')' before 'K'
    7 |                 if(P%2==0 K%P==0 && K!=P)
      |                   ~      ^~
      |                          )
Language: C

#include <stdio.h>
int main(){
   int N,K,P,i;
   scanf("%d",&N);
   for(i=1;i<=N;i++){
       scanf("%d%d",&K,&P);
       if(K%P=0){printf("%d\n",P);}
       slse{printf("%d\n",K/P);
           }
       return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:14: error: lvalue required as left operand of assignment
    7 |        if(K%P=0){printf("%d\n",P);}
      |              ^
main.c:8:8: error: 'slse' undeclared (first use in this function)
    8 |        slse{printf("%d\n",K/P);
      |        ^~~~
main.c:8:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:12: error: expected ';' before '{' token
    8 |        slse{printf("%d\n",K/P);
      |            ^
      |            ;
main.c:11:1: error: expected declaration or statement at end of input
   11 | }
      | ^
Language: C

#include<stdio.h>
int main(){
int n,a,b;
scanf("%d",&n);
for(;n-->0;){
scanf("%d%d",&a,&b);
printf("%d\n",(a%b==0?b:a%b))
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:30: error: expected ';' before '}' token
    7 | printf("%d\n",(a%b==0?b:a%b))
      |                              ^
      |                              ;
    8 | }
      | ~
Language: C

#include<iostream>
using namespace std;
int main(void)
{
	int a,b,K,P,i,j,N;
	scanf("%d ",&N);
	for(i=0;i<N;i++){
		scanf("%d %d",&K,&P);
		a=K%P;
		if(a==0){
			a=P;
		}
		printf("%d\n",a);
	}

	return 0;
}

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

#include<stdio.h>
int main(void)
{
	int p, k, i, N;
	scanf_s("%d", &N);
	for (i = 0; i < N; i++) {
		scanf_s("%d%d", &k, &p);
		if (k < p) {
			printf("%d\n", k);
		}
		else {
			if (k%p == 0) {
				printf("%d\n", p);
			}
			else {
				printf("%d\n", k%p);
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
int main(void)
{
	int P, K, i, N;
	scanf_s("%d", &N);
	for (i = 0; i < N; i++) {
		scanf_s("%d%d", &K, &P);
		if (K < P) {
			printf("%d\n", K);
		}
		else {
			if (K%P == 0) {
				printf("%d\n", P);
			}
			else {
				printf("%d\n", K%P);
			}
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
int main(void)
{
	int P, K, i, N,a[100];
	scanf_s("%d", &N);
	for (i = 0; i < N; i++) {
		scanf_s("%d%d", &K, &P);
		if (K < P) {
			a[i] = P;
		}
		else {
			if (K%P == 0) {
				a[i]=K;
			}
			else {
				a[i]=K%P;
			}
		}
	}
	for (i = 0; i < N; i++) {
		printf("%d\n", a[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
int main(void)
{
	int P, K, i, N,a[100];
	scanf_s("%d", &N);
	for (i = 0; i < N; i++) {
		scanf_s("%d%d", &K, &P);
		if (K < P) {
			a[i] = P;
		}
		else {
			if (K%P == 0) {
				a[i]=P;
			}
			else {
				a[i]=K%P;
			}
		}
	}
	for (i = 0; i < N; i++) {
		printf("%d\n", a[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>
int main(void)
{
	int P, K, i, N;
	scanf_s("%d", &N);
	for (i = 0; i < N; i++) {
		scanf_s("%d%d", &K, &P);
		if (K < P) {
			printf("%d\n", K);
		}
		else {
			printf("%d\n", K%P);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    5 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>
int main ( ){
  int N,i,P,K;

  for(i=0; i<N; i++){
    scanf("%d%d",&P&K);
    if(K%P==0)
      puts("P");
    else
      puts("K%P");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:20: error: invalid operands to binary & (have 'int *' and 'int')
    6 |     scanf("%d%d",&P&K);
      |                  ~~^
      |                  |
      |                  int *
Language: C

#include<stdio.h>
int main(){
  int N, K, P, i;
  


  for(i = 0; i <= N; i++ )
    { scanf("%d %d %d",&N, &K,&P);
    
     
    if(K%P==0)
      {printf("%d",P);
	
	   }
    else{printf("%d",K%P )
	    
	  }

}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:27: error: expected ';' before '}' token
   15 |     else{printf("%d",K%P )
      |                           ^
      |                           ;
   16 | 
   17 |           }
      |           ~
Language: C

#include<stdio.h>
int main(){
  int N, K, P, i;
  scanf("%d",&N);


  for(i = 0; i <= N; i++ )
    { scanf("%d %d",&K,&P);
    
     
    if(K%P == 0)
      {printf("%d",P);
	
	   }
    else{printf("%d",K%P )
	    
	  }

}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:27: error: expected ';' before '}' token
   15 |     else{printf("%d",K%P )
      |                           ^
      |                           ;
   16 | 
   17 |           }
      |           ~
Language: C

#include <stdio.h>
int main ( ){
  int N,i,P,K;
  scanf("%d",&N);
  
  for(i=0; i<N; i++){
    scanf("%d%d",&P&K);
    if(K%P==0)
      puts("P");
    else
      puts("K%P");
  }
  return 0;
}

    

Compiler output:
main.c: In function 'main':
main.c:7:20: error: invalid operands to binary & (have 'int *' and 'int')
    7 |     scanf("%d%d",&P&K);
      |                  ~~^
      |                  |
      |                  int *
Language: C

#include<stdio.h>
int main(){
  int N, K, P, i;
  scanf("%d",&N);


  for(i = 0; i <= N; i++ )
    { scanf("%d %d",&K,&P);
    
     
    if(K%P == 0)
      {printf("%d\n",P);
	
	   }
    else{printf("%d\n",K%P )
	    
	  }

}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:29: error: expected ';' before '}' token
   15 |     else{printf("%d\n",K%P )
      |                             ^
      |                             ;
   16 | 
   17 |           }
      |           ~
Language: C

#include <stdio.h>
int main ( ){
  int N,i,P,K;
  scanf("%d",&N);
  
  for(i=0; i<N; i++){
    scanf("%d%d",&P&K);
    if(K%P==0)
      printf("%d\n",P);
    else
      printf("%d\n",K%P);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:20: error: invalid operands to binary & (have 'int *' and 'int')
    7 |     scanf("%d%d",&P&K);
      |                  ~~^
      |                  |
      |                  int *
Language: C

#include <stdio.h>
int main ( ){
  int N,i,P,K;
  scanf("%d",&N);
  
  for(i=0; i<N; i++){
    scanf("%d%d",&P,&K);
    if(K%P==0)
      printf("%d\n",P);
    else
      printf("%d\n",K%P);
  }

Compiler output:
main.c: In function 'main':
main.c:12:3: error: expected declaration or statement at end of input
   12 |   }
      |   ^
Language: C

#include<stdio.h>
int main(void)
{
	int n, k, p, i, x, y, z;
	scanf("%d", &n);
	for (i = 1; i <= n; i++)
	{
		scanf("%d %d", &k, &p);
		x = k%p;
		if (x > 0)

			printf("%d\n", x);

		else (x == 0){

			y = 0;
			y = k / p;
			printf("%d\n", y);
		}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:30: error: expected ';' before '{' token
   14 |                 else (x == 0){
      |                              ^
      |                              ;
Language: C

#include<stdio.h>
int main(void)
{
	int n, k, p, i, x, y, z;
	scanf("%d", &n);
	for (i = 1; i <= n; i++)
	{
		scanf("%d %d", &k, &p);
		x = k%p;
		if (x > 0)

			printf("%d\n", x);

		else (x == 0)

			y = 0;
			y = k / p;
			printf("%d\n", y);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:30: error: expected ';' before 'y'
   14 |                 else (x == 0)
      |                              ^
      |                              ;
   15 | 
   16 |                         y = 0;
      |                         ~
Language: C

#include<stdio.h>
int main(void)
{
	int n, k, p, i, x, y, z;
	scanf("%d\n", &n);
	for (i = 1; i <= n; i++)
	{
		scanf("%d %d\n", &k, &p);
		x = k%p;
		if (x > 0)

			printf("%d\n", x);

		else (x == 0)

			y = 0;
			y = k / p;
			printf("%d\n", y);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:30: error: expected ';' before 'y'
   14 |                 else (x == 0)
      |                              ^
      |                              ;
   15 | 
   16 |                         y = 0;
      |                         ~
Language: C

#include<stdio.h>
int main(void)
{
	int n, k, p, i, x, y=0, z;
	scanf("%d\n", &n);
	for (i = 1; i <= n; i++)
	{
		scanf("%d %d\n", &k, &p);
		x = k%p ;
		if (x>0)

			printf("%d\n", x);

		else (x == 0)

			y = k / p;
			printf("%d\n", y);
         }
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:30: error: expected ';' before 'y'
   14 |                 else (x == 0)
      |                              ^
      |                              ;
   15 | 
   16 |                         y = k / p;
      |                         ~
Language: C

#include <stdio.h>

int main(void){
    int n, k, p;
    int i;

    scanf("%d", &n);
    for(i = 0; i < n; i++){
        scanf("%d %d", &k, &p);
        if(k % p == 0)
            printf("%d\n", p);
        else
            printf("%d\n", k % p);
    }
    return 0:
}

Compiler output:
main.c: In function 'main':
main.c:15:13: error: expected ';' before ':' token
   15 |     return 0:
      |             ^
      |             ;
Language: C

#include <stdio.h>
int main(void){
   
    int K,P,n;

    scanf ("%d",&K);
    scanf ("&d",&p);

    if (K % P == 0)
        n = P;
    else
        n = K % P;

    printf ("%d\n",n);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: 'p' undeclared (first use in this function)
    7 |     scanf ("&d",&p);
      |                  ^
main.c:7:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
   
    int K,P,N;

    scanf ("%d",&N);
    scanf ("%d",&K);
    scanf ("&d",&P);

    while (N > 0){
        if (K % P == 0)
            ptintf ("%d",n = P);
        else
            printf ("%d",n = K % P);
        N--;
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:13: error: implicit declaration of function 'ptintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   12 |             ptintf ("%d",n = P);
      |             ^~~~~~
      |             printf
main.c:12:26: error: 'n' undeclared (first use in this function)
   12 |             ptintf ("%d",n = P);
      |                          ^
main.c:12:26: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main(void){
   
    int K,P,N;

    scanf ("%d",&N);
    scanf ("%d",&K);
    scanf ("&d",&P);

    while (N > 0){
        if (K % P == 0)
            ptintf ("%d",P);
        else
            printf ("%d",K % P);
        N--;
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:13: error: implicit declaration of function 'ptintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   12 |             ptintf ("%d",P);
      |             ^~~~~~
      |             printf
Language: C

 1 #include <stdio.h>
  2 int main(void){
  3     int n,k[n],p[n],w[n];
  4     int i,j;
  5
  6     scanf("%d",&n);
  7
  8     for(i=0; i<n; i++){
  9
 10         scanf("%d %d",&k[i],&p[i]);
 11
 12         if(k[i]%p[i]==0)
 13             w[i]=p[i];
 14
 15         else
 16             w[i]=k[i]%p[i];
 17
 18         }
 19
 20     for(i=0; i<n; i++){
 21
 22         printf("%d\n",w[i]);
 23
 24     }
 25
 26     return 0;
 27
 28 }

Compiler output:
main.c:1:2: error: expected identifier or '(' before numeric constant
    1 |  1 #include <stdio.h>
      |  ^
main.c:1:4: error: stray '#' in program
    1 |  1 #include <stdio.h>
      |    ^
Language: C

#include <stdio.h>
int main(void){
   
    int K,P,N;

    scanf ("%d",&N);
    scanf ("%d",&K);
    scanf ("&d",&P);

    while (N > 0){
        if (K % P == 0)
            ptintf ("%d\n",P);
        else
            printf ("%d\n",K % P);
        N--;
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:13: error: implicit declaration of function 'ptintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   12 |             ptintf ("%d\n",P);
      |             ^~~~~~
      |             printf
Language: C

#include <stdio.h>
  2
  3 int main(void)
  4 {
  5     int times;              // N
  6     int value[times];       // K
  7     int headCount[times];   // P
  8     int i;
  9
 10     // printf("???????????????????????°?????\????????????????????????");
 11     scanf("%d", &times);
 12
 13     for (i = 0; i < times; i++)
 14     {
 15         // printf("???????????°??¨?????°?????\????????????????????????");
 16         scanf("%d %d", &value[i], &headCount[i]);
 17     }
 18
 19     for (i = 0; i < times; i++)
 20     {
 21         if ((value[i] % headCount[i]) == 0)
 22         {
 23             printf("%d\n", headCount[i]);
 24         }
 25         else
 26         {
 27             printf("%d\n", value[i] % headCount[i]);
 28         }
 29     }
 30
 31     return 0;
 32 }

Compiler output:
main.c:2:3: error: expected identifier or '(' before numeric constant
    2 |   2
      |   ^
Language: C

#include <stdio.h>
int main(void){
   
    int K,P,N;

    scanf ("%d",&N);

    while (N > 1){

        scanf ("%d",&K);
        scanf ("&d",&P);

        if (K % P == 0)
            ptintf ("%d\n",P);
        else
            printf ("%d\n",K % P);
        N--;
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:13: error: implicit declaration of function 'ptintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   14 |             ptintf ("%d\n",P);
      |             ^~~~~~
      |             printf
Language: C

#include <stdio.h>
int main(void){
   
    int K,P,N;

    scanf ("%d",&N);

    while (N > 1){

        scanf ("%d",&K);
        scanf ("%d",&P);

        if (K % P == 0)
            ptintf ("%d\n",P);
        else
            printf ("%d\n",K % P);
        N--;
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:13: error: implicit declaration of function 'ptintf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   14 |             ptintf ("%d\n",P);
      |             ^~~~~~
      |             printf
Language: C

#include <stdi.h>
 int main(void){
   int times,i;
   int K[times];
   int P[times];

   scanf("%d",&times);

   for(i=0;i<times;i++){
     scanf("%d %d",&K[i],&P[i]);
   }

   for(i=0;i<times;i++){
     if(K[i]%P[i]==0){
       printf("%d\n",P[i]);
     }else{
       printf("%d\n",K[i]%P[i]);
     }
   }
   return 0;
 }

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

#include<stdio.h>

int main(void){
    int w,n,i,k[n],p[n];
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d %d",&k[i],&p[i]);

    for(i=0;i<n;i++){
        w=k[i]%p[i];
        if(w==0)
            printf("%d\n",p[i]);
        else
            printf("%d\n",w);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:1: error: expected declaration or statement at end of input
   16 | }
      | ^
Language: C

#include<stdio.h>

int main(void){
    int w,n,i,k[n],p[n];
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%d %d",&k[i],&p[i]);
    for(i=0;i<n;i++){
         w=k[i]%p[i];
         if(w==0)
            printf("%d\n",p[i]);
         else
            printf("%d\n",w);
    }
    return 0;
 

Compiler output:
main.c: In function 'main':
main.c:15:5: error: expected declaration or statement at end of input
   15 |     return 0;
      |     ^~~~~~
Language: C

#include <stdio.h>
  int main(void){
    int i,n,k,p;
    int x[100];
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
        scanf("%d %d",&k,&p);
        if(k%p==0){
            w=p:
        }else if(k%p!=0){
            w=k%p;
        }
        x[i]=w;
     }
     for(i=0;i<n;i++){
        printf("%d\n",x[i]);
     }
     return 0;
     }

Compiler output:
main.c: In function 'main':
main.c:9:13: error: 'w' undeclared (first use in this function)
    9 |             w=p:
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:16: error: expected ';' before ':' token
    9 |             w=p:
      |                ^
      |                ;
Language: C

#include <stdio.h>
  int main(void){
    int i,n,k,p,w;
    int x[100];
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
        scanf("%d %d",&k,&p);
        if(k%p==0){
            w=p:
        }else if(k%p!=0){
            w=k%p;
        }
        x[i]=w;
     }
     for(i=0;i<n;i++){
        printf("%d\n",x[i]);
     }
     return 0;
     }

Compiler output:
main.c: In function 'main':
main.c:9:16: error: expected ';' before ':' token
    9 |             w=p:
      |                ^
      |                ;
Language: C++

#include<stdio.h>
int main(){
int n;scanf("%d",&n);while(n--){int a,b;scanf("%d%d",&a,&b);
int c=(a-1)%b+1;printf("%d\n",c);
}

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

#include<stdio.h>

int main(){

int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
int k,p;
scanf("%d%d",&k,&p);
int t=k%p;
t=p-t;
printf("%d\n",t);
}
return 0;
}#include<stdio.h>

int main(){

int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
int k,p;
scanf("%d%d",&k,&p);
int t=k%p;
if(t==0)t=p;
printf("%d\n",t);
}
return 0;
}

Compiler output:
a.cc:15:2: error: stray '#' in program
   15 | }#include<stdio.h>
      |  ^
a.cc:15:3: error: 'include' does not name a type
   15 | }#include<stdio.h>
      |   ^~~~~~~
Language: C++

#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
while(n--){
int a,b;
scanf("%d %d",&a,&b);
if(a<b){
printf("%d\n",a);
}else{
printf("%d\n"b%a);
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: unable to find string literal operator 'operator""b' with 'const char [4]', 'long unsigned int' arguments
   11 | printf("%d\n"b%a);
      |        ^~~~~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string>   
using namespace std;
 
int main(){
int a,ii = 0;
cin >> a;
int b[a],c[a],ans[a];
while(a > ii){
    cin >> b[ii] >> c[ii];
    ans[i] =  b[ii] % c[ii];
    if(ans[ii] == 0) ans[ii] = c[ii];
    ii++;
}
ii = 0;
while(a > ii){
cout << ans[ii] << endl;
ii++;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     ans[i] =  b[ii] % c[ii];
      |         ^
Language: C++

int main(){
    int n,k[1000],p[1000];
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>k[i]>>p[i];
    if(k[i]%p[i]==0)
        cout<<p[i]<<endl;
    else
        cout<<k[i]%p[i]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>n;
      |     ^~~
a.cc:7:9: error: 'cout' was not declared in this scope
    7 |         cout<<p[i]<<endl;
      |         ^~~~
a.cc:7:21: error: 'endl' was not declared in this scope
    7 |         cout<<p[i]<<endl;
      |                     ^~~~
a.cc:9:9: error: 'cout' was not declared in this scope
    9 |         cout<<k[i]%p[i]<<endl;
      |         ^~~~
a.cc:9:26: error: 'endl' was not declared in this scope
    9 |         cout<<k[i]%p[i]<<endl;
      |                          ^~~~
Language: C++

int main(){

    int a;
    std::cin >> a;
    while(a--){
        int n,m;
        std::cin >> n >> m;
        if(n % m ==0){
        	std::cout << m << std::endl;
        }else{
			std::cout << n % m << std::endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' is not a member of 'std'
    4 |     std::cin >> a;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:7:14: error: 'cin' is not a member of 'std'
    7 |         std::cin >> n >> m;
      |              ^~~
a.cc:7:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:22: error: 'cout' is not a member of 'std'
    9 |                 std::cout << m << std::endl;
      |                      ^~~~
a.cc:9:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:40: error: 'endl' is not a member of 'std'
    9 |                 std::cout << m << std::endl;
      |                                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(){
a.cc:11:30: error: 'cout' is not a member of 'std'
   11 |                         std::cout << n % m << std::endl;
      |                              ^~~~
a.cc:11:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:52: error: 'endl' is not a member of 'std'
   11 |                         std::cout << n % m << std::endl;
      |                                                    ^~~~
a.cc:11:52: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

int main(){

    int a;
    std::cin >> a;
    while(a--){
        int n,m;
        std::cin >> n >> m;
        std::cout << (n % m == 0 ? m : n % m) << std::endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' is not a member of 'std'
    4 |     std::cin >> a;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:7:14: error: 'cin' is not a member of 'std'
    7 |         std::cin >> n >> m;
      |              ^~~
a.cc:7:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:14: error: 'cout' is not a member of 'std'
    8 |         std::cout << (n % m == 0 ? m : n % m) << std::endl;
      |              ^~~~
a.cc:8:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:55: error: 'endl' is not a member of 'std'
    8 |         std::cout << (n % m == 0 ? m : n % m) << std::endl;
      |                                                       ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(){
Language: C++

int main(){

    int a;
    std::cin >> a;
    for(int i=a; i=0; i--){
        int n,m;
        std::cin >> n >> m;
        if(n % m ==0){
        	std::cout << m << std::endl;
        }else{
			std::cout << n % m << std::endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' is not a member of 'std'
    4 |     std::cin >> a;
      |          ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(){
a.cc:7:14: error: 'cin' is not a member of 'std'
    7 |         std::cin >> n >> m;
      |              ^~~
a.cc:7:14: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:22: error: 'cout' is not a member of 'std'
    9 |                 std::cout << m << std::endl;
      |                      ^~~~
a.cc:9:22: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:40: error: 'endl' is not a member of 'std'
    9 |                 std::cout << m << std::endl;
      |                                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | int main(){
a.cc:11:30: error: 'cout' is not a member of 'std'
   11 |                         std::cout << n % m << std::endl;
      |                              ^~~~
a.cc:11:30: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:11:52: error: 'endl' is not a member of 'std'
   11 |                         std::cout << n % m << std::endl;
      |                                                    ^~~~
a.cc:11:52: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include<iostream>
int main(){
    int a,b[1000],c[1000],d,e;
    std::cin >> a;
    for(int i=0;i<a;i++){
        std;;cin >> b[i] >> c[i];
    }
    for(int i=0;i<a;i++){
        std::cout << b[i]%+c[i] << std::endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected primary-expression before ';' token
    6 |         std;;cin >> b[i] >> c[i];
      |            ^
a.cc:6:14: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         std;;cin >> b[i] >> c[i];
      |              ^~~
      |              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
      |                  ^~~
Language: C++

#include<iostream>
int main(){
    int a,b[1000],c[1000],d,e;
    std::cin >> a;
    for(int i=0;i<a;i++){
        std;;cin >> b[i] >> c[i];
    }
    for(int i=0;i<a;i++){
        std::cout << b[i]%=c[i] << std::endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected primary-expression before ';' token
    6 |         std;;cin >> b[i] >> c[i];
      |            ^
a.cc:6:14: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         std;;cin >> b[i] >> c[i];
      |              ^~~
      |              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:9:33: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |         std::cout << b[i]%=c[i] << std::endl;
      |                            ~~~~~^~~~~~~~~~~~
Language: C++

#include<iostream>
int main(){
    int a,b[1000],c[1000];
    std::cin >> a;
    for(int i=0;i<a;i++){
        std;;cin >> b[i] >> c[i];
    }
    for(int i=0;i<a;i++){
        std::cout << b[i]%=c[i] << std::endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected primary-expression before ';' token
    6 |         std;;cin >> b[i] >> c[i];
      |            ^
a.cc:6:14: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         std;;cin >> b[i] >> c[i];
      |              ^~~
      |              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:9:33: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    9 |         std::cout << b[i]%=c[i] << std::endl;
      |                            ~~~~~^~~~~~~~~~~~
Language: C++

#include<iostream>
int main(){
    int a,b[1000],c[1000];
    std::cin >> a;
    for(int i=0;i<a;i++){
        std;;cin >> b[i] >> c[i];
    }
    for(int i=0;i<a;i++){
        if(b[i]%c[i] == 0)b[i]%=c[i]+1;
        else b[i]%=c[i]
        std::cout << b[i] << std::endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: expected primary-expression before ';' token
    6 |         std;;cin >> b[i] >> c[i];
      |            ^
a.cc:6:14: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         std;;cin >> b[i] >> c[i];
      |              ^~~
      |              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:10:24: error: expected ';' before 'std'
   10 |         else b[i]%=c[i]
      |                        ^
      |                        ;
   11 |         std::cout << b[i] << std::endl;
      |         ~~~
Language: C++

#include<iostream>
using namespace std;
int n,k,p,ke;
int in(){
cin>>n;
}
int out(){
for(int a=0;a<n;a++){
cin>>k>>p;
ke=k%p;
if(k==0)
ke=p;
cout<<ke<<endl;
}
int main(){
in();
out();
}

Compiler output:
a.cc: In function 'int in()':
a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type]
    6 | }
      | ^
a.cc: In function 'int out()':
a.cc:15:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 | int main(){
      |         ^~
a.cc:15:9: note: remove parentheses to default-initialize a variable
   15 | int main(){
      |         ^~
      |         --
a.cc:15:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:11: error: a function-definition is not allowed here before '{' token
   15 | int main(){
      |           ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:7:10: note: to match this '{'
    7 | int out(){
      |          ^
a.cc:18:2: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      |  ^
Language: C++

#include<iostream>
using namespace std;
int n,k,p,ke;
int in(){
cin>>n;
}
int out(){
for(int a=0;a<n;a++){
cin>>k>>p;
ke=k%p;
if(ke==0)
ke=p;
cout<<ke<<endl;
}
int main(){
in();
out();
}

Compiler output:
a.cc: In function 'int in()':
a.cc:6:1: warning: no return statement in function returning non-void [-Wreturn-type]
    6 | }
      | ^
a.cc: In function 'int out()':
a.cc:15:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   15 | int main(){
      |         ^~
a.cc:15:9: note: remove parentheses to default-initialize a variable
   15 | int main(){
      |         ^~
      |         --
a.cc:15:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:15:11: error: a function-definition is not allowed here before '{' token
   15 | int main(){
      |           ^
a.cc:18:2: error: expected '}' at end of input
   18 | }
      |  ^
a.cc:7:10: note: to match this '{'
    7 | int out(){
      |          ^
a.cc:18:2: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      |  ^
Language: C++

import java.util.*;

class Main{

    int n,m;
    int a,b;
    Main(){
        Scanner sc = new Scanner(System.in);
        n=sc.nextInt();
        while(n>0){
            n--;
            a=sc.nextInt();
            b=sc.nextInt();
            m=a%b;
            if(m==0)m=b;
            System.out.println(m);
        }


    }

    public static void main(String[] args){
        new Main();
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:22:11: error: expected ':' before 'static'
   22 |     public static void main(String[] args){
      |           ^~~~~~~
      |           :
a.cc:22:29: error: 'String' has not been declared
   22 |     public static void main(String[] args){
      |                             ^~~~~~
a.cc:22:38: error: expected ',' or '...' before 'args'
   22 |     public static void main(String[] args){
      |                                      ^~~~
a.cc:25:2: error: expected ';' after class definition
   25 | }
      |  ^
      |  ;
a.cc: In constructor 'Main::Main()':
a.cc:8:9: error: 'Scanner' was not declared in this scope
    8 |         Scanner sc = new Scanner(System.in);
      |         ^~~~~~~
a.cc:9:11: error: 'sc' was not declared in this scope
    9 |         n=sc.nextInt();
      |           ^~
a.cc:16:13: error: 'System' was not declared in this scope
   16 |             System.out.println(m);
      |             ^~~~~~
Language: C++

n = int(input())
for i in range(n):
  k, p = map(int, input().split())
  if k % p == 0:
    print(p)
  else:
    print(k % p)

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

#include<cstdio>
int main()
{
  int n,k,p;
  scanf("%d",&n);
  for(int i=0;i<=n-1;i++) {
    scanf("%d",&k,&p);
    if(k%p==0) printf("%d\n",p);
    else if(k%p!=0) int b=k%p;printf("%d\n",b);
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:45: error: 'b' was not declared in this scope
    9 |     else if(k%p!=0) int b=k%p;printf("%d\n",b);
      |                                             ^
Language: C++

import java.util.*;

class Main{
	public static void main(String[] args){
		Solve s = new Solve();
		s.solve();
	}	
}

class Solve{
	Solve(){}
	
	Scanner in = new Scanner(System.in);

	void solve(){
		int n = in.nextInt();

		for(int i = 0; i < n; i++){
			int a = in.nextInt(), b = in.nextInt();
			int c = (a % b == 0 ? b : a % b);
			System.out.println(a % b);
		}
	}
	
}

// while(in.hasNext()){
		// 	int n = in.nextInt();
		// 	if(n == 0) return;
			
		// }

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
    4 |         public static void main(String[] args){
      |               ^~~~~~~
      |               :
a.cc:4:33: error: 'String' has not been declared
    4 |         public static void main(String[] args){
      |                                 ^~~~~~
a.cc:4:42: error: expected ',' or '...' before 'args'
    4 |         public static void main(String[] args){
      |                                          ^~~~
a.cc:8:2: error: expected ';' after class definition
    8 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::main(int*)':
a.cc:5:17: error: 'Solve' was not declared in this scope
    5 |                 Solve s = new Solve();
      |                 ^~~~~
a.cc:6:17: error: 's' was not declared in this scope
    6 |                 s.solve();
      |                 ^
a.cc: At global scope:
a.cc:13:9: error: 'Scanner' does not name a type
   13 |         Scanner in = new Scanner(System.in);
      |         ^~~~~~~
a.cc:25:2: error: expected ';' after class definition
   25 | }
      |  ^
      |  ;
a.cc: In member function 'void Solve::solve()':
a.cc:16:25: error: 'in' was not declared in this scope; did you mean 'int'?
   16 |                 int n = in.nextInt();
      |                         ^~
      |                         int
a.cc:20:38: error: 'b' was not declared in this scope
   20 |                         int c = (a % b == 0 ? b : a % b);
      |                                      ^
a.cc:21:25: error: 'System' was not declared in this scope
   21 |                         System.out.println(a % b);
      |                         ^~~~~~