Language: C

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

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

void enqueue(P);
P dequeue();

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

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

P dequeue(){
  if(head == n) head=1;
  else head++;
}


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

  while(elaps !=n){
    u = dequeue();
    if(u.t-q <= 0){
      c += u.t;
      u.t = 0;
      elaps++;
      printf("%s %d\n",u.name,c);
    }
    else if(u.t > 0){
      c += q;
      u.t -+ q;
      enqueue(u);
    }
  }
  return 0;
}
#include<stdio.h>
#include<string.h>
#define LEN 100005

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

void enqueue(P);
P dequeue();

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

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

P dequeue(){
  if(head == n) head=1;
  else head++;
}


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

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

Compiler output:
main.c:59:16: error: redefinition of 'struct pp'
   59 | typedef struct pp{
      |                ^~
main.c:5:16: note: originally defined here
    5 | typedef struct pp{
      |                ^~
main.c:62:2: error: conflicting types for 'P'; have 'struct pp'
   62 | }P;
      |  ^
main.c:8:2: note: previous declaration of 'P' with type 'P' {aka 'struct pp'}
    8 | }P;
      |  ^
main.c:64:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
   64 | void enqueue(P);
      |      ^~~~~~~
main.c:16:6: note: previous definition of 'enqueue' with type 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:65:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
   65 | P dequeue();
      |   ^~~~~~~
main.c:22:3: note: previous definition of 'dequeue' with type 'P()' {aka 'struct pp()'}
   22 | P dequeue(){
      |   ^~~~~~~
main.c:67:3: error: conflicting types for 'Q'; have 'P[100006]' {aka 'struct pp[100006]'}
   67 | P Q[LEN+1];
      |   ^
main.c:13:3: note: previous declaration of 'Q' with type 'P[100006]' {aka 'struct pp[100006]'}
   13 | P Q[LEN+1];
      |   ^
main.c:68:5: error: redefinition of 'head'
   68 | int head=0, tail=0, n;
      |     ^~~~
main.c:14:5: note: previous definition of 'head' with type 'int'
   14 | int head=0, tail=0, n;
      |     ^~~~
main.c:68:13: error: redefinition of 'tail'
   68 | int head=0, tail=0, n;
      |             ^~~~
main.c:14:13: note: previous definition of 'tail' with type 'int'
   14 | int head=0, tail=0, n;
      |             ^~~~
main.c:70:6: error: conflicting types for 'enqueue'; have 'void(P)' {aka 'void(struct pp)'}
   70 | void enqueue(P x){
      |      ^~~~~~~
main.c:16:6: note: previous definition of 'enqueue' with type 'void(P)' {aka 'void(struct pp)'}
   16 | void enqueue(P x){
      |      ^~~~~~~
main.c:76:3: error: conflicting types for 'dequeue'; have 'P()' {aka 'struct pp()'}
   76 | P dequeue(){
      |   ^~~~~~~
main.c:22:3: note: previous definition of 'dequeue' with type 'P()' {aka 'struct pp()'}
   22 | P dequeue(){
      |   ^~~~~~~
main.c:82:5: error: redefinition of 'main'
   82 | int main(){
      |     ^~~~
main.c:28:5: note: previous definition of 'main' with type 'int()'
   28 | int main(){
      |     ^~~~