Language: C++

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

int main(){
  bool data[15][15];
  for(int i=0;i<15;i++){
    for(int j=0;j<15;j++){
      data[i][j]=false;
    }
  }

  for(int count=0;count<7;count++){
    data[0][count+8]=true;
  }

  for(int i=1;i<15;i++){
    for(int j=0;j<15;j++){
      if(j==0) data[i][j]=data[i-1][14];
      else data[i][j]=data[i-1][j-1];
    }
  }

  while(1){
    int n;
    cin >> n;
    if(n==0) return 0;
    getchar();
    string in;
    bool input[15];
    for(int i=0;i<15;i++) input[i]=false;
    for(int i=0;i<n;i++){
      getline(cin, in);
      if(in=="Rock") input[0]=true;
      else if(in=="Gun") input[1]=true;
      else if(in=="Lightning") input[2]=true;
      else if(in=="Devil") input[3]=true;
      else if(in=="Dragon") input[4]=true;
      else if(in=="Water") input[5]=true;
      else if(in=="Air") input[6]=true;
      else if(in=="Paper") input[7]=true;
      else if(in=="Sponge") input[8]=true;
      else if(in=="Wolf") input[9]=true;
      else if(in=="Tree") input[10]=true;
      else if(in=="Human") input[11]=true;
      else if(in=="Snake") input[12]=true;
      else if(in=="Scissors") input[13]=true;
      else if(in=="Fire") input[14]=true;
    }
    int ans=15;
    for(int i=0;i<15;i++){
      if(!input[i]) continue;
      bool flag=true;
      bool fkati=false;
      for(int j=0;j<15;j++){
        if(i==j) continue;
        if(!input[j]) continue;
        if(data[i][j]) fkati=true;
        if(!data[i][j]){
          flag=false;
          break;
        }
      }
      if(flag && fkati){
        ans=i;
        break;
      }
    }

    switch(ans){
    case 0:
      cout << "Rock" << endl;
      break;
    case 1:
      cout << "Gun" << endl;
      break;
    case 2:
      cout << "Lightning" << endl;
      break;
    case 3:
      cout << "Devil" << endl;
      break;
    case 4:
      cout << "Dragon" << endl;
      break;
    case 5:
      cout << "Water" << endl;
      break;
    case 6:
      cout << "Air" << endl;
      break;
    case 7:
      cout << "Paper" << endl;
      break;
    case 8:
      cout << "Sponge" << endl;
      break;
    case 9:
      cout << "Wolf" << endl;
      break;
    case 10:
      cout << "Tree" << endl;
      break;
    case 11:
      cout << "Human" << endl;
      break;
    case 12:
      cout << "Snake" << endl;
      break;
    case 13:
      cout << "Scissors" << endl;
      break;
    case 14:
      cout << "Fire" << endl;
      break;
    default:
      cout << "Draw" << endl;
      break;
    }
  }
  return 0;
}

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

int main(){
  bool data[15][15];
  for(int i=0;i<15;i++){
    for(int j=0;j<15;j++){
      data[i][j]=false;
    }
  }

  for(int count=0;count<7;count++){
    data[0][count+8]=true;
  }

  for(int i=1;i<15;i++){
    for(int j=0;j<15;j++){
      if(j==0) data[i][j]=data[i-1][14];
      else data[i][j]=data[i-1][j-1];
    }
  }

  while(1){
    int n;
    cin >> n;
    if(n==0) return 0;
    getchar();
    string in;
    bool input[15];
    for(int i=0;i<15;i++) input[i]=false;
    for(int i=0;i<n;i++){
      getline(cin, in);
      if(in=="Rock") input[0]=true;
      else if(in=="Gun") input[1]=true;
      else if(in=="Lightning") input[2]=true;
      else if(in=="Devil") input[3]=true;
      else if(in=="Dragon") input[4]=true;
      else if(in=="Water") input[5]=true;
      else if(in=="Air") input[6]=true;
      else if(in=="Paper") input[7]=true;
      else if(in=="Sponge") input[8]=true;
      else if(in=="Wolf") input[9]=true;
      else if(in=="Tree") input[10]=true;
      else if(in=="Human") input[11]=true;
      else if(in=="Snake") input[12]=true;
      else if(in=="Scissors") input[13]=true;
      else if(in=="Fire") input[14]=true;
    }
    int ans=15;
    for(int i=0;i<15;i++){
      if(!input[i]) continue;
      bool flag=true;
      bool fkati=false;
      for(int j=0;j<15;j++){
        if(i==j) continue;
        if(!input[j]) continue;
        if(data[i][j]) fkati=true;
        if(!data[i][j]){
          flag=false;
          break;
        }
      }
      if(flag && fkati){
        ans=i;
        break;
      }
    }

    switch(ans){
    case 0:
      cout << "Rock" << endl;
      break;
    case 1:
      cout << "Gun" << endl;
      break;
    case 2:
      cout << "Lightning" << endl;
      break;
    case 3:
      cout << "Devil" << endl;
      break;
    case 4:
      cout << "Dragon" << endl;
      break;
    case 5:
      cout << "Water" << endl;
      break;
    case 6:
      cout << "Air" << endl;
      break;
    case 7:
      cout << "Paper" << endl;
      break;
    case 8:
      cout << "Sponge" << endl;
      break;
    case 9:
      cout << "Wolf" << endl;
      break;
    case 10:
      cout << "Tree" << endl;
      break;
    case 11:
      cout << "Human" << endl;
      break;
    case 12:
      cout << "Snake" << endl;
      break;
    case 13:
      cout << "Scissors" << endl;
      break;
    case 14:
      cout << "Fire" << endl;
      break;
    default:
      cout << "Draw" << endl;
      break;
    }
  }
  return 0;
}

Compiler output:
a.cc:128:5: error: redefinition of 'int main()'
  128 | int main(){
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(){
      |     ^~~~