Submission #341476

# Submission time Handle Problem Language Result Execution time Memory
341476 2020-12-29T20:05:21 Z Iwanttobreakfree Cluedo (IOI10_cluedo) C++
Compilation error
0 ms 0 KB
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include "grader.h"
#include "cluedo.h"
using namespace std;

int Theory(int M,int L,int W){
	cin>>Murderer>>Location>>Weapon;
	if (M!=Murderer){
	return 1;
	}
	else if (L!=Location){
	return 2;
	}
	else if (W!=Weapon){
	return 3;
	}
	else{
	return 0;
	}	
}

void Solve(){
   int r,Murderer,Location,Weapon;
   r = Theory(1,2,3);
   if (r == 0) return;
   r = Theory(3,2,1);
   if (r == 0) return;
   r = Theory(4,4,4);
   if (r == 0) return;
}

Compilation message

cluedo.cpp: In function 'int Theory(int, int, int)':
cluedo.cpp:11:7: error: 'Murderer' was not declared in this scope
   11 |  cin>>Murderer>>Location>>Weapon;
      |       ^~~~~~~~
cluedo.cpp:11:17: error: 'Location' was not declared in this scope
   11 |  cin>>Murderer>>Location>>Weapon;
      |                 ^~~~~~~~
cluedo.cpp:11:27: error: 'Weapon' was not declared in this scope
   11 |  cin>>Murderer>>Location>>Weapon;
      |                           ^~~~~~
cluedo.cpp: In function 'void Solve()':
cluedo.cpp:27:10: warning: unused variable 'Murderer' [-Wunused-variable]
   27 |    int r,Murderer,Location,Weapon;
      |          ^~~~~~~~
cluedo.cpp:27:19: warning: unused variable 'Location' [-Wunused-variable]
   27 |    int r,Murderer,Location,Weapon;
      |                   ^~~~~~~~
cluedo.cpp:27:28: warning: unused variable 'Weapon' [-Wunused-variable]
   27 |    int r,Murderer,Location,Weapon;
      |                            ^~~~~~
cluedo.cpp: In function 'int Theory(int, int, int)':
cluedo.cpp:24:1: warning: control reaches end of non-void function [-Wreturn-type]
   24 | }
      | ^