Submission #998344

#TimeUsernameProblemLanguageResultExecution timeMemory
998344SonicMLMemory (IOI10_memory)C++14
Compilation error
0 ms0 KiB
#include "grader.h" 
#include "memory.h" 
 
void play() { 
   
  char ch; 
  int flip[25]; 
  bool firstCard = true; 
  for(int pos = 1;pos <= 50;pos++) { 
    ch = faceup(pos); 
    if(firstCard == true) { 
      if(flip[ch-'a'] != 0) { 
        faceup(flip[ch-'a']); 
      }else{     
        firstCard = false; 
      } 
    }else { 
      if(flip[ch-'a'] != 0) { 
        faceup(flip[ch-'a']);    
        faceup(pos); 
        firstCard = true; 
      }else { 
        firstCard = true;  
      } 
    } 
    flip[ch-'a'] = pos; 
  } 
  return 0; 
} 
 

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:28:10: error: return-statement with a value, in function returning 'void' [-fpermissive]
   28 |   return 0;
      |          ^