#include "grader.h"
#include "memory.h"
int posFirst[25], posSecond[25];
void play() {
for (int ch = 0; ch < 25; ch++) {
posFirst[ch] = -1;
posSecond[ch] = -1;
}
for (int i = 1; i <= 50; i += 2) {
char firstCard = faceup(i);
char secondCard = faceup(i + 1);
if (posFirst[firstCard - 'A'] == -1) {
posFirst[firstCard - 'A'] = i;
}
else {
posSecond[firstCard - 'A'] = i;
}
if (posFirst[secondCard - 'A'] == -1) {
posFirst[secondCard - 'A'] = i + 1;
}
else {
posSecond[secondCard - 'A'] = i + 1;
}
}
for (int ch = 0; ch < 25; ch++) {
faceup(posFirst[ch]);
faceup(posSecond[ch]);
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |