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

#include <iostream>
#include <stdio.h>
#include <string.h>

#define len 100005

typedef struct pp{
    char name[100];
    int time;
}p;

p queue[len];
int head,tail;

void enqueue(p n){
    queue[tail]=n;
    tail=(tail+1)%len;
}

p dequeue(){
     p v=queue[head];
    head=(head+1)%len;
    return v;
}

int min(int a,int b){
    return a<b?a:b;
}

int main() {
    int n,t,i,c;
    int sum=0;
    p u;
    scanf("%d %d",&n,&t);
    for (i = 1; i <= n; ++i) {
        scanf("%s",queue[i].name);
        scanf("%d",&queue[i].time);
    }

    head=1;
    tail=n+1;

    while(head!=tail){
        //????????????,?????´??????
        u=dequeue();
        c=min(u.time,t);
        //??????????????¶??´
        sum+=c;
        //??´??°????¨???¶??´
        u.time-=c;
        if(u.time>0){
            enqueue(u);
        } else{
            printf("%s %d\n",u.name,sum);
        }
    }

    return 0;
}

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

#include<stdio,h>
#include<string.h>
struct Data{
  char name[11];
  int t;
};

struct Data Q[1001];
int n, head=1, tail=1;

void enqueue(struct Data x){
  Q[tail] = x;
  if(tail == n)
    tail = 1;
  else
    tail++;
}

struct Data dequeue(){
  struct Data x;
  x = Q[head];

  if(head == n)
    head = 1;
  else head++;

  return x;
}

int main(){
  int i, q, count=0, time=0;
  struct Data a;

  scanf("%d%d", &n, &q);

  for(i = 1; i <= n; i++)
    scanf("%s%d", Q[i].name, &Q[i].t);

  while(count != n){
    a = dequeue();

    if(a.t <= q){
      time += a.t;
      printf("%s %d\n", a.name, time);
      count++;
    }

    else{
      time += q;
      a.t -= q;
      enqueue(a);
    }
  }

  return 0;
}

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

#include<stdio,h>
#include<string.h>

struct Data{
  char name[11];
  int t;
};

struct Data Q[1001];
int n, head=1, tail=1;

void enqueue(struct Data x){
  Q[tail] = x;
  if(tail == n)
    tail = 1;
  else
    tail++;
}

struct Data dequeue(){
  struct Data x;
  x = Q[head];

  if(head == n)
    head = 1;
  else head++;

  return x;
}

int main(){
  int i, q, count=0, time=0;
  struct Data a;

  scanf("%d%d", &n, &q);

  for(i = 1; i <= n; i++)
    scanf("%s%d", Q[i].name, &Q[i].t);

  while(count != n){
    a = dequeue();

    if(a.t <= q){
      time += a.t;
      printf("%s %d\n", a.name, time);
      count++;
    }

    else{
      time += q;
      a.t -= q;
      enqueue(a);
    }
  }

  return 0;
}

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

#include <stdio.h>
#include <string.h>
#define N 100000
 
 
typedef struct
{
  int time;
  char name[10];
}P;
 
int head,tail,n;
int  min(int,int);
void enqueue(Pro);
P dequeue(void);
 
P Q[N];
 
int main()
{
  int q,i,c,e=0;
  P z;
 
  scanf("%d%d",&n,&q);
  
  for(i=1;i<=n;i++)
    {
      scanf("%s%d" ,Q[i].name,&Q[i].time);
    }
  
  head = 1;
  tail = n+1;
  while(head!=tail)
    {
      z = dequeue();
      c = min(q,z.time);
      z.time -= c;
      e += c;
      if(z.time > 0)
	{
	  enqueue(z);
	}
      else printf("%s %d\n",z.name,e);
    }
  return 0;
}
 
void enqueue(Pro x)
{
  Q[tail] = x;
  tail = (tail + 1)% N;
}

P dequeue()
{
  P x;  
  x = Q[head];
  head = (head + 1) % N;
    
  return x;  
}
 
int min(int v, int w)
{
  return v < w ? v:w;
}

Compiler output:
main.c:14:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
   14 | void enqueue(Pro);
      | ^~~~
main.c:48:14: error: unknown type name 'Pro'
   48 | void enqueue(Pro x)
      |              ^~~
Language: C

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

#define true 1

struct Line {
	char name[15];
	int time;
};

int N, Q;
int stack_number = 0;
int count;

int main(void) {
	scanf("%d %d", N, Q);

	struct Line line[N + 1];
	int stack[N+1];
	memset(stack, '\0');

	for (int i = 0; i < N; i++) {
		scanf("%s %d", line[i].name, line[i].time);
		line[i].number = i;
		stack[i] = i;
		stack_number = i;
	}
	
	
	while (true) {
		if (line[stack[0]].time > Q) {
			line[stack[0]].time -= Q;
			stack[stack_number + 1] = stack[0];
			for (int i = 0; i <= stack_number; i++) {
				stack[i] = stack[i + 1];
			}
			count += Q;
		}
		else {
			count += stack[0].time;
			printf("%s %d\n", line[stack[0]].name, count);
			for (int i = 0; i < stack_number; i++) {
				stack[i] = stack[i + 1];
			}
			stack_number--;
			if (stack_number == -1) {
				return 0;
			}
		}
	}
}

Compiler output:
main.c: In function 'main':
main.c:21:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration]
   21 |         memset(stack, '\0');
      |         ^~~~~~
main.c:4:1: note: include '<string.h>' or provide a declaration of 'memset'
    3 | #include <stdlib.h>
  +++ |+#include <string.h>
    4 | 
main.c:21:9: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch]
   21 |         memset(stack, '\0');
      |         ^~~~~~
main.c:21:9: note: include '<string.h>' or provide a declaration of 'memset'
main.c:21:9: error: too few arguments to function 'memset'
main.c:25:24: error: 'struct Line' has no member named 'number'
   25 |                 line[i].number = i;
      |                        ^
main.c:41:42: error: request for member 'time' in something not a structure or union
   41 |                         count += stack[0].time;
      |                                          ^
Language: C

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

#define true 1

struct Line {
	char name[15];
	int time;
};

int N, Q;
int stack_number = 0;
int count;

int main(void) {
	scanf("%d %d", N, Q);

	struct Line line[N + 1];
	int stack[N+1];
	memset(stack, '\0');

	for (int i = 0; i < N; i++) {
		scanf("%s %d", line[i].name, line[i].time);
		stack[i] = i;
		stack_number = i;
	}
	
	
	while (true) {
		if (line[stack[0]].time > Q) {
			line[stack[0]].time -= Q;
			stack[stack_number + 1] = stack[0];
			for (int i = 0; i <= stack_number; i++) {
				stack[i] = stack[i + 1];
			}
			count += Q;
		}
		else {
			count += stack[0].time;
			printf("%s %d\n", line[stack[0]].name, count);
			for (int i = 0; i < stack_number; i++) {
				stack[i] = stack[i + 1];
			}
			stack_number--;
			if (stack_number == -1) {
				return 0;
			}
		}
	}
}

Compiler output:
main.c: In function 'main':
main.c:22:9: error: too few arguments to function 'memset'
   22 |         memset(stack, '\0');
      |         ^~~~~~
In file included from main.c:4:
/usr/include/string.h:61:14: note: declared here
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |              ^~~~~~
main.c:41:42: error: request for member 'time' in something not a structure or union
   41 |                         count += stack[0].time;
      |                                          ^
Language: C

#include<stdio.h>
#include<fstream>
#include<algorithm>
#include<cmath>
#include<iostream>
using namespace std;
struct renwu{
  char m[1000];
  int t;
}a[1000000];
int main()
{
    int n;int p;
    int x=0;
    scanf("%d%d",&n,&p);
    int k=0,l=0;
    for(int i=0;i<n;i++)
    {
        scanf("%s%d",a[i].m,&a[i].t);
    }
    int head=0;
    int tail=n;
    while(head!=tail)
    {
        k=min(p,a[head].t);
        x+=k;
        a[head].t-=k;
        if(a[head].t>0)
        {
           a[tail]=a[head];tail=(tail+1)%(100005);
        }
        else
        {
          printf("%s %d\n",a[head].m,x);
        }
        head=(head+1)%(100005);
    }
    return 0;
}

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

#include<stdio.h>
#include<fstream>
#include<algorithm>
using namespace std;
struct renwu{
  char m[1000];
  int t;
}a[1000000];
int main()
{
    int n;int p;
    int x=0;
    scanf("%d%d",&n,&p);
    int k=0,l=0;
    for(int i=0;i<n;i++)
    {
        scanf("%s%d",a[i].m,&a[i].t);
    }
    int head=0;
    int tail=n;
    while(head!=tail)
    {
        k=min(p,a[head].t);
        x+=k;
        a[head].t-=k;
        if(a[head].t>0)
        {
           a[tail]=a[head];tail=(tail+1)%(100005);
        }
        else
        {
          printf("%s %d\n",a[head].m,x);
        }
        head=(head+1)%(100005);
    }
    return 0;
}

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

#include<stdio.h>
//#include<fstream>
#include<algorithm>
using namespace std;
struct renwu{
  char m[1000];
  int t;
}a[1000000];
int main()
{
    int n;int p;
    int x=0;
    scanf("%d%d",&n,&p);
    int k=0,l=0;
    for(int i=0;i<n;i++)
    {
        scanf("%s%d",a[i].m,&a[i].t);
    }
    int head=0;
    int tail=n;
    while(head!=tail)
    {
        k=min(p,a[head].t);
        x+=k;
        a[head].t-=k;
        if(a[head].t>0)
        {
           a[tail]=a[head];tail=(tail+1)%(100005);
        }
        else
        {
          printf("%s %d\n",a[head].m,x);
        }
        head=(head+1)%(100005);
    }
    return 0;
}

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

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];
int head, tail, n;

void enqueue(P x){
Q[tail] = x;
if tail == LEN tail=0;
else tail++;
}

P dequeue(){
P x = Q[head];
if head == LEN head=0;
else head ++;
return x;
}


int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

  while (head!=tail){
    u = dequeue();
    if u.t <= 100{
      elaps += u.t;
      printf("%s %d\n",u.name,elaps);
    }
    else {
      elaps += 100;
      u.t -= 100;
      enqueue(u);
    }
  
  return 0;
}

Compiler output:
main.c: In function 'enqueue':
main.c:15:4: error: expected '(' before 'tail'
   15 | if tail == LEN tail=0;
      |    ^~~~
      |    (
main.c: In function 'dequeue':
main.c:21:4: error: expected '(' before 'head'
   21 | if head == LEN head=0;
      |    ^~~~
      |    (
main.c: In function 'main':
main.c:40:8: error: expected '(' before 'u'
   40 |     if u.t <= 100{
      |        ^
      |        (
main.c:51:1: error: expected declaration or statement at end of input
   51 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];
int head, tail, n;

void enqueue(P x){
  Q[tail] = x;
  if tail == LEN{
    tail=0;
  }
  else tail++;
}

P dequeue(){
  P x = Q[head];
  if head == LEN{
    head=0;
  }
  else head ++;
  return x;
}


int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

  while (head!=tail){
    u = dequeue();
    if u.t <= 100{
      elaps += u.t;
      printf("%s %d\n",u.name,elaps);
    }
    else {
      elaps += 100;
      u.t -= 100;
      enqueue(u);
    }
  
  return 0;
}

Compiler output:
main.c: In function 'enqueue':
main.c:15:6: error: expected '(' before 'tail'
   15 |   if tail == LEN{
      |      ^~~~
      |      (
main.c: In function 'dequeue':
main.c:23:6: error: expected '(' before 'head'
   23 |   if head == LEN{
      |      ^~~~
      |      (
main.c: In function 'main':
main.c:44:8: error: expected '(' before 'u'
   44 |     if u.t <= 100{
      |        ^
      |        (
main.c:55:1: error: expected declaration or statement at end of input
   55 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];
int head, tail, n;

void enqueue(P x){
  Q[tail] = x;
  if (tail == LEN) tail=0;
  else tail++;
}

P dequeue(){
  P x = Q[head];
  if (head == LEN) head=0;
  else head ++;
  return x;
}


int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

  while (head!=tail){
    u = dequeue();
    if u.t <= 100{
      elaps += u.t;
      printf("%s %d\n",u.name,elaps);
    }
    else {
      elaps += 100;
      u.t -= 100;
      enqueue(u);
    }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:40:8: error: expected '(' before 'u'
   40 |     if u.t <= 100{
      |        ^
      |        (
main.c:51:1: error: expected declaration or statement at end of input
   51 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];
int head, tail, n;

void enqueue(P x){
  Q[tail] = x;
  if (tail == LEN) tail=0;
  else tail++;
}

P dequeue(){
  P x = Q[head];
  if (head == LEN) head=0;
  else head ++;
  return x;
}


int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 0; i < n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }

  while (head!=tail){
    u = dequeue();
    if (u.t <= 100){
      elaps += u.t;
      printf("%s %d\n",u.name,elaps);
    }
    else {
      elaps += 100;
      u.t -= 100;
      enqueue(u);
    }
  
  return 0;
}

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

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
    char name[100];
    int t;
}P

P Q[LEN];
int head, tail, n;

void enqueue( P x ){
    Q[tail] = x;
    tail = (tail + 1) % LEN;
}

P dequeue(){
    P x = Q[head];
    head = (head + 1) % LEN;
    return x;
}

int min(int a, int b) { return a < b ? a : b; }

int main()
{
    int elaps = 0, c;
    int i, q;
    P u;
    scanf("%d %d", &n, &q);
    for(i = 1; i <= n; i++){
        scanf("%s %d", Q[i].name, &Q[i].t);
    }
    head = 1; tail = n + 1;

    while( head != tail ){
        u = dequeue();
        c = min(q, u.t);
        u.t -= c;
        elaps += c;
        if( u.t > 0 ) enqueue(u);
        else{
            printf("%s %d\n", u.name, elaps);
        }
    }
    return 0;
}

Compiler output:
main.c:10:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'P'
   10 | P Q[LEN];
      | ^
main.c:10:1: error: unknown type name 'P'
main.c:13:15: error: unknown type name 'P'
   13 | void enqueue( P x ){
      |               ^
main.c:18:1: error: unknown type name 'P'
   18 | P dequeue(){
      | ^
main.c: In function 'dequeue':
main.c:19:5: error: unknown type name 'P'
   19 |     P x = Q[head];
      |     ^
main.c:19:11: error: 'Q' undeclared (first use in this function)
   19 |     P x = Q[head];
      |           ^
main.c:19:11: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:30:5: error: unknown type name 'P'
   30 |     P u;
      |     ^
main.c:33:24: error: 'Q' undeclared (first use in this function)
   33 |         scanf("%s %d", Q[i].name, &Q[i].t);
      |                        ^
main.c:39:21: error: request for member 't' in something not a structure or union
   39 |         c = min(q, u.t);
      |                     ^
main.c:40:10: error: request for member 't' in something not a structure or union
   40 |         u.t -= c;
      |          ^
main.c:42:14: error: request for member 't' in something not a structure or union
   42 |         if( u.t > 0 ) enqueue(u);
      |              ^
main.c:42:23: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   42 |         if( u.t > 0 ) enqueue(u);
      |                       ^~~~~~~
      |                       dequeue
main.c:44:32: error: request for member 'name' in something not a structure or union
   44 |             printf("%s %d\n", u.name, elaps);
      |                                ^
Language: C

#include <stdio.h>

typedef struct Process{
	char name[10];
	int time;
}process;

int main(void){
	int i,j,n,q,t;
	
	scanf("%d",&n);
	scanf("%d",&q);	
	process p[n];
		
	for(i=0;i<n;i++){
		scanf("%s",p[i].name);
		scanf("%d",&p[i].time);
	}
	
	i=0;
	t=0;
	while(i<n){
		for(j=0;j<n;j++){
			if(p[j].time>0){
				if(p[j].time<=q){
					t += p[j].time;
					p[j].finish=t;
					p[j].time=0;
					printf("%s %d\n",p[j].name,t);
				}
				else{
					p[j].time -= q;
					t += q;
				}
			}
		}
	}
	
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:45: error: 'process' {aka 'struct Process'} has no member named 'finish'
   27 |                                         p[j].finish=t;
      |                                             ^
Language: C

#include <stdio.h>
#include <string.h>

int main(void)
{
	int  pn;					/* process num */
	int  pt;					/* process time */
	char name_buff[100000][10];	/* Name Buffer */
	int  time_buff[100000];		/* Time Buffer */
	int  data_num = 0;
	int  bp = 0;				/* Buffer Position */
	
	/* get "process num" & "process time" */
	scanf("%d %d", &pn &pt);
	
	/* get Name & time */
	while(scanf("%s %d", name_buff[data_num], &(time_buff[data_num])) != EOF)
	{
		data_num++;
	}
	
	/* get Data Num equal process num */
	if( data_num == pn )
	{
		while(pn > 0)
		{
			/* remain process time */
			if(time_buff[bp] > 0)
			{
				if( time_buff[bp] > pt )
				{
					time_buff[bp] -= pt;
				}
				else
				{
					printf("%s %d\n", name_buff[bp], time_buff[bp]); /* output finished process */
					time_buff[bp] = 0;
					pn--;
				}
			}
			else
			{
				/* Already Finish */
			}
			
			bp++;
		}
	}
	else
	{
		/* error input */
	}
	
	return 0;
}

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

#include<stdio.h>
#include<string.h>
??
//?§???????
typedef struct {
????char name[10];
????int t;
}Process;
??
??
//????????????????????£?¨?
void enqueue(Process);
Process dequeue(void);
??
//??°?????????????????°
Process Q[100000];
int n,q;
int ttime;
int i,j;
??
int main(void){
??
????int count=0;
????Process stack[1000];
??
????scanf("%d %d", &n, &q);
??
????//?????±?????\???????????\???
????for ( i = 0; i < n; i++){
????????scanf("%s", Q[i].name);
????????scanf("%d", &Q[i].t);
????}
??
????for(i=0;i<n+j;i++){
????stack[count] = dequeue();
????if(stack[count].t != -1)
????enqueue(stack[count++]);
????}
??
????return 0;
}
??
??
//?????????????????????????????¨?????????
void enqueue(Process x){
??
????printf("%s %d\n",x.name,x.t);
}
??
Process dequeue(void){
??
????int flag=0;
??
????????if(Q[i].t <= q){
????????????ttime += Q[i].t;
????????????Q[i].t = ttime;
????????????flag=1;
????????} 
????????else{
????????????ttime += q;
????????????Q[n+j].t = Q[i].t - q;
????????????strcpy(Q[n+j].name,Q[i].name);
????????????j++;
????????}
??
????????if(flag==0)
????????????Q[i].t = -1;
??
????????????return Q[i];
??????????????
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
main.c:8:2: warning: data definition has no type or storage class
    8 | }Process;
      |  ^~~~~~~
main.c:8:2: error: type defaults to 'int' in declaration of 'Process' [-Wimplicit-int]
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??
      | ^
main.c:13:1: error: unknown type name 'Process'
   13 | Process dequeue(void);
      | ^~~~~~~
main.c:14:1: error: expected identifier or '(' before '?' token
   14 | ??
      | ^
main.c:20:1: error: expected identifier or '(' before '?' token
   20 | ??
      | ^
main.c:28:3: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
   28 | ????//?????±?????\???????????\???
main.c:42:1: error: expected identifier or '(' before '?' token
   42 | ??
      | ^
main.c:49:1: error: expected identifier or '(' before '?' token
   49 | ??
      | ^
Language: C

#include<stdio.h>
#include<string.h>
 
typedef struct p{
  char name[100];
  int time;
}Process;
 
Process Que[10000];
int head, tail, n;
 
void enqueue(Process x){
  Que[tail] = x;
  tail = (tail + 1)%10000;
}
 
Process dequeue(){
  Process x = Que[head];
  head = (head + 1)%10000;
  return x;
}
 
int min(int a, int b){ 
  return a < b ? a:b;
}
 
int main(void){
  int e = 0;
  int i, q, c;
  Process u;
  head = 1;
  tail = n+1;
  scanf("%d %d", &n, &q);
  for(i=1;i<=n;i++){
    scanf("%s",Que[i].name);
    scanf("%d",&Que[i].time);
  }
  while(head != tail){
    u = dequeue();
    c = min(q,u.t);
    u.time -= c;
    e += c;
    if(u.t > 0){
      enqueue(u);
    }
    else{
      printf("%s %d\n",u.name,e);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:40:16: error: 'Process' {aka 'struct p'} has no member named 't'
   40 |     c = min(q,u.t);
      |                ^
main.c:43:9: error: 'Process' {aka 'struct p'} has no member named 't'
   43 |     if(u.t > 0){
      |         ^
Language: C

#include <stdio.h>
#define M 100000
typedef struct {
  char name[10];
  int t;
} QUEUE;

QUEUE que[MAX];
int front, rear;

void Enqueue(QUEUE x) {
  if (rear == M) rear = 0;
  que[rear] = x;
  rear++;
}

QUEUE Dequeue(void) {
  if (M == front) front = 0;
  return que[front++];
}

int main(int argc, char const *argv[]) {
  int i, n, q, exet = 0;
  QUEUE queue;
  scanf("%d %d", &n, &q);
  for (i = 0; i < n; i++) {
    scanf("%s %d", queue.name, &queue.t);
    Enqueue(queue);
  }

  while (n != 0) {
    queue = Dequeue();
    if (queue.t > q) {
      queue.t = queue.t - q;
      exet = exet + q;
      Enqueue(queue);
    } else {
      exet = exet + queue.t;
      printf("%s %d\n", queue.name, exet);
      n--;
    }
  }
  return 0;
}

Compiler output:
main.c:8:11: error: 'MAX' undeclared here (not in a function)
    8 | QUEUE que[MAX];
      |           ^~~
Language: C

#include <stdio.h>
#include <string.h>

#define QUEUE_DATA_MAX 100000

typedef struct ST_QueueData
{
    char name_buff[10];     /* Name Buffer */
    int  time_buff;         /* Time Buffer */
	int  *next;             /* Next Point */
}QueueData_t;

QueueData_t tQueueDataBuffer[QUEUE_DATA_MAX];

int main(void)
{
    int  pn;                      /* process num */
    int  pt;                      /* process time */
    int  data_num = 0;
    int  elapsed_time = 0;
    int  *before_next = 0;        /* Befor Next Point */
    QueueData_t *ptQueueDataNow;  /* Now Queue Data Point */
    
    /* get "process num" & "process time" */
    scanf("%d %d", &pn, &pt);
     
    /* get Name & time */
    while((scanf("%s %d", tQueueDataBuffer[data_num].name_buff, &(tQueueDataBuffer[data_num].time_buff)) != EOF) && data_num < QUEUE_DATA_MAX)
    {
        data_num++;
    	tQueueDataBuffer[data_num-1].next = (int*)tQueueDataBuffer[data_num];
    }
    
	tQueueDataBuffer[data_num-1].next = (int*)tQueueDataBuffer[0];
	ptQueueDataNow = (int*)tQueueDataBuffer[0];
	before_next = tQueueDataBuffer[data_num-1].next;
	
    /* get Data Num equal process num */
    if( data_num == pn )
    {
        while(pn > 0)
        {
            /* remain process time */
            if( ptQueueDataNow->time_buff > pt )
            {
                ptQueueDataNow->time_buff -= pt;
                elapsed_time += pt;
                before_next = (int*)ptQueueDataNow;
           }
            else
            {
                elapsed_time += ptQueueDataNow->time_buff;
                printf("%s %d\n", ptQueueDataNow->name_buff, elapsed_time); /* output finished process */
                ptQueueDataNow->time_buff = 0;
                before_next = ptQueueDataNow->next;                         /* dequeue */
                pn--;
            }
             
            /* Next buffer point */
            ptQueueDataNow = (QueueData_t *)ptQueueDataNow->next;
        }
    }
    else
    {
        /* error input */
    }
     
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:9: error: cannot convert to a pointer type
   31 |         tQueueDataBuffer[data_num-1].next = (int*)tQueueDataBuffer[data_num];
      |         ^~~~~~~~~~~~~~~~
main.c:34:9: error: cannot convert to a pointer type
   34 |         tQueueDataBuffer[data_num-1].next = (int*)tQueueDataBuffer[0];
      |         ^~~~~~~~~~~~~~~~
main.c:35:9: error: cannot convert to a pointer type
   35 |         ptQueueDataNow = (int*)tQueueDataBuffer[0];
      |         ^~~~~~~~~~~~~~
Language: C

#include <stdio.h>
#include <string.h>

#define LEN 100005

typedef struct pp{
    char name[100];
    int t;
} P;

P Q[LEN];
int head, tail, n;

void enqueue(P x){
    Q[tail] = x;
    tail = (tail + 1) % LEN;
}

P dequeue(){
    P x = Q[head];
    head = (head+1)%LEN;
    return x;
}

int min(int a, int b){return a < b? a: b;}

int main(){
    int elaps = 0, c;
    int i, q;
    P u;
    scanf("%d %d", &n, &q);

    for(i = 1; i <=n; i++){
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
    head = 1;
    tail = n+1;

    while (head != tail){
        u = dequeue();
        c = min(q, u.t);
        u.t -= c;
        elaps += c;
        if (u.t>0) enqueue(u)
        else {
            printf("%s %d\n", u.name, elaps);
        }
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:45:30: error: expected ';' before 'else'
   45 |         if (u.t>0) enqueue(u)
      |                              ^
      |                              ;
   46 |         else {
      |         ~~~~
Language: C

#include<iostream>
#include<cstring>
using namespace std;
struct scheduler
    {
        int process;
        int q;
        string name[100000];
        int time[100000];
        int total_time;
        int alltime;
        int list[100000];
        int timenow[100000];
    };
int main()
{
    scheduler std;
    std.total_time=0,std.alltime=0;
    int k=0,tmp;
    cin>>std.process>>std.q;
    for(int i=0;i<std.process;i++)
    {
        cin>>std.name[i]>>std.time[i];
        std.alltime+=std.time[i];
    }
    for(int i=0;std.alltime!=std.total_time;i++)
    {

        if(std.time[i]==0)
        {
            if(i==std.process-1)
                i=-1;
            continue;
        }
        if(std.time[i]>std.q)
        {
            std.time[i]-=std.q;
            std.total_time+=std.q;
        }
        else if(std.time[i]<=std.q)
        {
            std.total_time+=std.time[i];
            std.time[i]=0;
            std.timenow[k]=std.total_time;
            std.list[k]=i;
            k++;
        }
        if(i==std.process-1)
        {
            i=-1;
        }
    }
    for(int i=0;i<k;i++)
    {
        tmp=std.list[i];
        cout<<std.name[tmp]<<' '<<std.timenow[i]<<endl;
    }
}




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

#include <cstdio>

int head, tail;
#define len 100010
typedef struct pp {
    char name[20];
    int time;
} P;
P Q[len];

void enqueue(P x) {
    Q[tail] = x;
    tail = (tail+1)%len;
}
P dequeue() {
    P x = Q[head];
    head = (head+1)%len;
    return x;
}
int min(int a, int b) {return a<b?a:b;}

int main()
{
    #ifdef LOCAL
        freopen("E:\\Temp\\input.txt", "r", stdin);
        freopen("E:\\Temp\\output.txt", "w", stdout);
    #endif

    int n, q, last = 0;
    scanf("%d%d", &n, &q);
    for(int i=0; i<n; ++i)
        scanf("%s%d", Q[i].name, &Q[i].time);

    head = 0, tail = n;
    while(head != tail) {
        P u = dequeue();
        int x = min(q, u.time);
        u.time -= x; last += x;
        if(u.time) enqueue(u);
        else printf("%s %d\n", u.name, last);
    } 

    return 0;
}


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

// キュー
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>

//const int MAX_N = 100000;
const int STR_LEN = 10;

// キュー関連の定義
const int Max_Queue = 100000;

// キューの要素の構造体
typedef struct q_e
{
    // 配列の要素No.
    int id;
    // プロセス名
    char process_name[STR_LEN];
    // プロセスの時間
    int process_time;
}queue_element;

queue_element ary_queue[Max_Queue];

// キューの情報の構造体
typedef struct q_i
{
    int top;
    int tail;
    int count;
}queue_info;

queue_info que_info;

void create_queue(void);
int enqueue(queue_element element);
queue_element dequeue(void);

int main(void)
{

    int N, cpu_time, total_time = 0;
    char str[STR_LEN];
    queue_element que_ele;

    // キューの初期化
    create_queue();

    scanf("%d %d", &N, &cpu_time);

    for(int i = 0; i < N; i++)
    {
    	que_ele.id = i;

        scanf("%s", &str[0]);
        strcpy(&(que_ele.process_name[0]), &str[0]);

        scanf("%s", &str[0]);
        que_ele.process_time = atoi(str);

        // キューに挿入する
        enqueue(que_ele);
    }

    // cpuの時間を割り当てる
    while( que_info.count > 0 )
    {
        // キューからポップする
        que_ele = dequeue();

        if( 0 < que_ele.process_time
            && que_ele.process_time <= cpu_time )
        {
            total_time += que_ele.process_time;
            que_ele.process_time = 0;

            printf("%s %d\n", que_ele.process_name, total_time);
        }
        else
        {
            total_time += cpu_time;
            que_ele.process_time -= cpu_time;

            enqueue(que_ele);
        }
    }

    return 0;

}

// キューを作成する関数
void create_queue(void)
{
    int i;

    for(i = 0; i < Max_Queue; i++)
    {
        // キューの初期化
    	ary_queue[i].id = 0;
        ary_queue[i].process_name[0] = '\0';
        ary_queue[i].process_time = 0;
    }

    que_info.top = 0;
    que_info.tail = 0;
    que_info.count = 0;

    return;
}

// キューへプッシュする関数
int enqueue(queue_element element)
{

    if( que_info.count > Max_Queue )
    {
        // サイズオーバー
        return INT_MIN;
    }

    if( que_info.tail == Max_Queue - 1 )
    {
        // 配列をラウンド型にする
        que_info.tail = -1;
    }

    // キューに追加する
    ary_queue[que_info.tail++] = element;
    que_info.count++;

    return 0;
}

// キューからポップする関数
queue_element dequeue(void)
{
    queue_element ret;

    if( que_info.count < 0 )
    {
        // キューが空の時
        ret.id = INT_MIN;
    }
    else
    {
        if( que_info.top == Max_Queue - 1 )
        {
            // 配列をラウンド型にする
            que_info.top = -1;
        }

        ret = ary_queue[que_info.top++];
    }

    que_info.count--;

    return ret;
}



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

// キュー
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<limits.h>

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>

//const int MAX_N = 100000;
const int STR_LEN = 10;

// キュー関連の定義
//const int Max_Queue = 100000;
const int Max_Queue = 10000;
const int Queue_Error = -2147483648;

// キューの要素の構造体
typedef struct q_e
{
    // 配列の要素No.
    int id;
    // プロセス名
    char process_name[STR_LEN];
    // プロセスの時間
    int process_time;
}queue_element;

queue_element ary_queue[Max_Queue];

// キューの情報の構造体
typedef struct q_i
{
    int head;
    int tail;
}queue_info;

queue_info que_info;

void create_queue(void);
int enqueue(queue_element element);
queue_element dequeue(void);

int main(void)
{

    int N, cpu_time, total_time = 0;
    char str[STR_LEN];
    queue_element que_ele;

    // キューの初期化
    create_queue();

    scanf("%d %d", &N, &cpu_time);

    for(int i = 0; i < N; i++)
    {
    	que_ele.id = i;

        scanf("%s", &str[0]);
        strcpy(&(que_ele.process_name[0]), &str[0]);

        scanf("%s", &str[0]);
        que_ele.process_time = atoi(str);

        // キューに挿入する
        enqueue(que_ele);
    }

    // cpuの時間を割り当てる
    while( que_info.head != que_info.tail )
    {
        // キューからポップする
        que_ele = dequeue();

        if( 0 < que_ele.process_time
            && que_ele.process_time <= cpu_time )
        {
            total_time += que_ele.process_time;
            que_ele.process_time = 0;

            printf("%s %d\n", que_ele.process_name, total_time);
        }
        else
        {
            total_time += cpu_time;
            que_ele.process_time -= cpu_time;

            enqueue(que_ele);
        }
    }

    return 0;

}

// キューを作成する関数
void create_queue(void)
{
    int i;

    for(i = 0; i < Max_Queue; i++)
    {
        // キュー要素の初期化
    	ary_queue[i].id = 0;
        ary_queue[i].process_name[0] = '\0';
        ary_queue[i].process_time = 0;
    }

    que_info.head = 0;
    que_info.tail = 0;

    return;
}

// キューへプッシュする関数
int enqueue(queue_element element)
{

    if( que_info.head == ( que_info.tail + 1 ) % Max_Queue )
    {
        // キューが満杯
        return Queue_Error;
        printf("Queue_Error\n");
    }

    if( que_info.tail == Max_Queue - 1 )
    {
        // 配列をラウンド型にする
        que_info.tail = -1;
    }

    // キューに追加する
    ary_queue[que_info.tail++] = element;

    return 0;
}

// キューからポップする関数
queue_element dequeue(void)
{
    queue_element ret;

    if( que_info.head == que_info.tail )
    {
        // キューが空の時
        ret.id = Queue_Error;
    }
    else
    {
        if( que_info.head == Max_Queue - 1 )
        {
            // 配列をラウンド型にする
            que_info.head = -1;
        }

        // キューから取り出す
        ret = ary_queue[que_info.head++];
    }

    return ret;
}



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

#include <stdio.h>
#include <string.h>
#define LEN 100005

struct P
{
	char chName[20];
	int nT;
};

P In[LEN];
int nHead, nTail;
int n;

void enqueue(P x)
{
	In[nTail] = x;
	nTail = (nTail + 1) % (n+2);
}

P dequeue()
{
	P ret = In[nHead];
	nHead = (nHead + 1) % (n+2);
	return ret;
}

int main()
{
	int q, nTime = 0;
	P pTemp;
	scanf("%d %d", &n, &q);
	for (int i = 1; i <= n; ++i)
	{
		scanf("%s %d", &In[i].chName, &In[i].nT);
	}
	nHead = 1;
	nTail = n + 1;
	while (nHead != nTail)
	{
		pTemp = dequeue();
		if (pTemp.nT <= q)
		{
			nTime += pTemp.nT;
			printf("%s %d\n", pTemp.chName, nTime);
		}
		else
		{
			nTime += q;
			pTemp.nT -= q;
			enqueue(pTemp);
		}
	}
	return 0;
}


Compiler output:
main.c:11:1: error: unknown type name 'P'; use 'struct' keyword to refer to the type
   11 | P In[LEN];
      | ^
      | struct 
main.c:15:14: error: unknown type name 'P'
   15 | void enqueue(P x)
      |              ^
main.c:21:1: error: unknown type name 'P'; use 'struct' keyword to refer to the type
   21 | P dequeue()
      | ^
      | struct 
main.c: In function 'dequeue':
main.c:23:9: error: unknown type name 'P'; use 'struct' keyword to refer to the type
   23 |         P ret = In[nHead];
      |         ^
      |         struct 
main.c: In function 'main':
main.c:31:9: error: unknown type name 'P'; use 'struct' keyword to refer to the type
   31 |         P pTemp;
      |         ^
      |         struct 
main.c:35:38: error: request for member 'chName' in something not a structure or union
   35 |                 scanf("%s %d", &In[i].chName, &In[i].nT);
      |                                      ^
main.c:35:53: error: request for member 'nT' in something not a structure or union
   35 |                 scanf("%s %d", &In[i].chName, &In[i].nT);
      |                                                     ^
main.c:42:26: error: request for member 'nT' in something not a structure or union
   42 |                 if (pTemp.nT <= q)
      |                          ^
main.c:44:39: error: request for member 'nT' in something not a structure or union
   44 |                         nTime += pTemp.nT;
      |                                       ^
main.c:45:48: error: request for member 'chName' in something not a structure or union
   45 |                         printf("%s %d\n", pTemp.chName, nTime);
      |                                                ^
main.c:50:30: error: request for member 'nT' in something not a structure or union
   50 |                         pTemp.nT -= q;
      |                              ^
main.c:51:25: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   51 |                         enqueue(pTemp);
      |                         ^~~~~~~
      |                         dequeue
Language: C

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
} P;

P Q[LEN];
int head,tail,n;

void enqueue(P x){
  Q[tail]=x;
  tail=(tail+1)%LEN;
}

P dequeue(){
  P x=Q[head];
  head = (head+1)%LEN;
  return x;
}

int min(int a,int b){return a<b?a:b;}

int main(){
  int elaps=0,c;
  int i,q;
  P u;
  scanf("%d %d",&n,&q);
  for(i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }
  head=1;
  tail=n+1;

  while(head != tail){
    u=dequeue();
    c=min(q,u,t);
    u.t -= c;
    elaps += c;
    if(u.t>0) enqueue(u);
    else{
      printf("%s %d\n",u.name,elaps);
    }
  }

  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:40:15: error: 't' undeclared (first use in this function)
   40 |     c=min(q,u,t);
      |               ^
main.c:40:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:40:13: error: incompatible type for argument 2 of 'min'
   40 |     c=min(q,u,t);
      |             ^
      |             |
      |             P {aka struct pp}
main.c:24:19: note: expected 'int' but argument is of type 'P' {aka 'struct pp'}
   24 | int min(int a,int b){return a<b?a:b;}
      |               ~~~~^
main.c:40:7: error: too many arguments to function 'min'
   40 |     c=min(q,u,t);
      |       ^~~
main.c:24:5: note: declared here
   24 | int min(int a,int b){return a<b?a:b;}
      |     ^~~
Language: C

#include<stdio.h>
#include<string.h>

#define LEN 100005

typedof struct pp{
  char name[100];
  int t;
}P;

P Q[LEN];
int head,tail,n;

void enqueue(P x){
  Q[tail] = x;
  tail = (tail +1) & LEN;
}

P dequeue(){
  P x = Q[head];
  head = (head + 1) % LEN;
  return x;
}

int min(int a,int b){ return a < b ? a : b;}

int main(){
  int elaps = 0, c;
  int i,q;
  P u;

  scanf("%d %d",&n,&q);
  
  
  for(i = 1; i <= n; i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }
  head = 1;
  tail = n + 1;

  while(head != tail){
    u = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps += c;
    if(u.t > 0)enqueue(u);
    else{
      printf("%s %d\n",u.name,elaps);
    }
  }
  return
    }



Compiler output:
main.c:6:8: error: expected ';' before 'struct'
    6 | typedof struct pp{
      |        ^~~~~~~
      |        ;
main.c:11:1: error: unknown type name 'P'
   11 | P Q[LEN];
      | ^
main.c:14:14: error: expected declaration specifiers or '...' before 'P'
   14 | void enqueue(P x){
      |              ^
main.c:19:1: error: unknown type name 'P'
   19 | P dequeue(){
      | ^
main.c: In function 'dequeue':
main.c:20:4: error: expected ';' before 'x'
   20 |   P x = Q[head];
      |    ^~
      |    ;
main.c:22:10: error: 'x' undeclared (first use in this function)
   22 |   return x;
      |          ^
main.c:22:10: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:30:4: error: expected ';' before 'u'
   30 |   P u;
      |    ^~
      |    ;
main.c:36:20: error: request for member 'name' in something not a structure or union
   36 |     scanf("%s",Q[i].name);
      |                    ^
main.c:37:21: error: request for member 't' in something not a structure or union
   37 |     scanf("%d",&Q[i].t);
      |                     ^
main.c:43:5: error: 'u' undeclared (first use in this function)
   43 |     u = dequeue();
      |     ^
main.c:47:16: error: implicit declaration of function 'enqueue'; did you mean 'dequeue'? [-Wimplicit-function-declaration]
   47 |     if(u.t > 0)enqueue(u);
      |                ^~~~~~~
      |                dequeue
main.c:53:5: error: expected expression before '}' token
   53 |     }
      |     ^
Language: C

#include<stdio.h>
#include<string.h>

#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN];
int head,tail,n;

void enqueue(P x){
  Q[tail] = x;
  tail = (tail +1) & LEN;
}

P dequeue(){
  P x = Q[head];
  head = (head + 1) % LEN;
  return x;
}

int min(int a,int b){ return a < b ? a : b;}

int main(){
  int elaps = 0, c;
  int i,q;
  P u;

  scanf("%d %d",&n,&q);
  
  
  for(i = 1; i <= n; i++){
    scanf("%s",Q[i].name);
    scanf("%d",&Q[i].t);
  }
  head = 1;
  tail = n + 1;

  while(head != tail){
    u = dequeue();
    c = min(q,u.t);
    u.t -= c;
    elaps += c;
    if(u.t > 0)enqueue(u);
    else{
      printf("%s %d\n",u.name,elaps);
    }
  }
  return
    }



Compiler output:
main.c: In function 'main':
main.c:53:5: error: expected expression before '}' token
   53 |     }
      |     ^
Language: C

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

typedef struct{
  char name[10];
  int t;
}Data;

typedef struct{
  int tail;
  Data *data;
  int n;
}Queue;

void initqueue(Queue*, int);
int enqueue(Queue*, Data);
Data dequeue(Queue*);

void dprint(Queue);

void initqueue(Queue *q, int n){
  q->tail = 0;
  q->n = n;
  q->data = (Data *)malloc(sizeof(Data) * n);
}

int enqueue(Queue *q, Data in){
  //if(q->tail < q->n){
    q->data[q->tail] = in;
    q->tail ++;
    return 1;
  //}
  //return 0;
//}

Data dequeue(Queue *q){
  int i;
  Data out;
  //if(q->tail >= 0){
    out = q->data[0];
    q->tail --;
    for(i=1;i<=q->tail;i++){
      q->data[i-1] = q->data[i];
    }
    return out;
  //}
  printf("DEQUEUE EROOR\n");
   return out;
}

int main(){
  int i, n, q, tcount=0;
  Queue Q;
  Data data, *out;

  scanf("%d%d",&n,&q);
  initqueue(&Q, n);
  out = (Data *)malloc(sizeof(Data) * n);
  for(i=0;i<n;i++){
    scanf("%s %d",data.name, &data.t);
    enqueue(&Q, data);
  }

  while(Q.tail > 0){
    //dprint(Q);
    data = dequeue(&Q);
    if(data.t > q){
      data.t -= q;
      enqueue(&Q, data);
      tcount += q;
    } else {
      tcount += data.t;
      printf("%s %d\n",data.name, tcount);
    }
  }

  /*for(i=0;i<n;i++){
    printf("%s %d\n",out[i].name, out[i].time);
  }*/

  //dprint(Q);
  return 0;
}


void dprint(Queue Q){
  int i, j;
  Data inp;
  for(i=0;i<Q.tail;i++){
    printf("%s %d\n",Q.data[i].name, Q.data[i].t);
  }
  printf("\n\n");
  if(0){
    for(j=0;j<Q.n;j++){
      inp = dequeue(&Q);
      printf("dequeue %s %d\n",inp.name, inp.t);
      for(i=0;i<Q.tail;i++){
        printf("%s %d\n",Q.data[i].name, Q.data[i].t);
      }
    }
  }
}



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

#include<stdio.h>
#include<string.h>

#define MAX 150000

typedef struct Point{
  char data[100];
  int t;
} Point;

Point set[Max];
int heard;
int tail;
int k;

int main(){
  int el = 0;
  int c;
  int i;
  int l;
  Point u;

  scanf("%d %d",&k,&l);

  for(i = 0;i <= k;i++){
    scanf("%s",set[i].data);
    scanf("%d",&set[i].t);
  }
  head = 1;
  tail = k + 1;

  while(head != tail){
    u = notequal();
    c = minixm(l,u.t);
    u.t -= c;
    el += c;
    if(u.t > 0){
      equal(u);
    }
    else{
      printf("%s %d\n",u.name,el)
    }
  }
  return 0;
}


void equal(Point x){
  set[tail] = x;
  tail = (tail + 1) % MAX;
  return x;
}

Point notequal(){
  Point x = set[head];
  head = (head + 1) % MAX;
  return x;
}

int minixm(int a,int b){
  return a < b ? a : b;
}



Compiler output:
main.c:11:11: error: 'Max' undeclared here (not in a function); did you mean 'MAX'?
   11 | Point set[Max];
      |           ^~~
      |           MAX
main.c: In function 'main':
main.c:29:3: error: 'head' undeclared (first use in this function); did you mean 'heard'?
   29 |   head = 1;
      |   ^~~~
      |   heard
main.c:29:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:33:9: error: implicit declaration of function 'notequal' [-Wimplicit-function-declaration]
   33 |     u = notequal();
      |         ^~~~~~~~
main.c:33:9: error: incompatible types when assigning to type 'Point' from type 'int'
main.c:34:9: error: implicit declaration of function 'minixm' [-Wimplicit-function-declaration]
   34 |     c = minixm(l,u.t);
      |         ^~~~~~
main.c:38:7: error: implicit declaration of function 'equal' [-Wimplicit-function-declaration]
   38 |       equal(u);
      |       ^~~~~
main.c:41:25: error: 'Point' has no member named 'name'
   41 |       printf("%s %d\n",u.name,el)
      |                         ^
main.c:41:34: error: expected ';' before '}' token
   41 |       printf("%s %d\n",u.name,el)
      |                                  ^
      |                                  ;
   42 |     }
      |     ~                             
main.c: At top level:
main.c:48:6: warning: conflicting types for 'equal'; have 'void(Point)'
   48 | void equal(Point x){
      |      ^~~~~
main.c:38:7: note: previous implicit declaration of 'equal' with type 'void(Point)'
   38 |       equal(u);
      |       ^~~~~
main.c: In function 'equal':
main.c:51:10: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   51 |   return x;
      |          ^
main.c:48:6: note: declared here
   48 | void equal(Point x){
      |      ^~~~~
main.c: At top level:
main.c:54:7: error: conflicting types for 'notequal'; have 'Point()'
   54 | Point notequal(){
      |       ^~~~~~~~
main.c:33:9: note: previous implicit declaration of 'notequal' with type 'int()'
   33 |     u = notequal();
      |         ^~~~~~~~
main.c: In function 'notequal':
main.c:55:17: error: 'head' undeclared (first use in this function); did you mean 'heard'?
   55 |   Point x = set[head];
      |                 ^~~~
      |                 heard
Language: C

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

#define M 100000

typedef struct q{
  char name[10];
  int v;
} q;


int head,tail,n;
q Q[M];
q A;


bool isEnpty(){
  if(tail == head) true;
  else false;
}


void enqueue(q x){
  Q[tail] = x;
  if(tail+1 == M) tail = 0;
  else tail = tail +1;
}
			  
q dequeue(q *Q){
  q x;
  x = Q[head];
  if(head+1 == M) head = 0;
  else head = head +1;
  return x;
}


int main(){

  int i,value,x,y,total=0,k=0;


  scanf("%d%d",&n, &value);

  head = 1;
  tail = n+1;

  for(i=1;i<=n;i++){
    scanf("%s%d",Q[i].name,&Q[i].v);
  }

  while(head != tail){

    A = dequeue(Q);
    k = min(value,A.v);
    A.v -= k;
    total += k;
    if(A.v > 0) enqueue(A);
    else printf("%s %d\n",A.name,total);

  }

    
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:57:9: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration]
   57 |     k = min(value,A.v);
      |         ^~~
      |         main