QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#623185 | #5732. Even or Odd | oschlimgen | WA | 0ms | 3604kb | C++20 | 652b | 2024-10-09 10:30:42 | 2024-10-09 10:30:48 |
Judging History
answer
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <fstream>
class inputParams {
public:
int n;
inputParams() : n(0) {
read();
}
void read() {
std::string line;
std::getline(std::cin, line);
if(line.size() > 0) {
n = line[0] - '0';
}
if(line.size() > 1) {
n = 10;
}
}
};
std::string createOutput(int n) {
if(n % 2 == 0) {
return "Odd";
} else {
return "Either";
}
}
int main() {
inputParams input;
std::string output = createOutput(input.n);
std::cout << output << std::endl;
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3600kb
input:
1
output:
Either
result:
ok single line: 'Either'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
2
output:
Odd
result:
ok single line: 'Odd'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
3
output:
Either
result:
ok single line: 'Either'
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3508kb
input:
4
output:
Odd
result:
wrong answer 1st lines differ - expected: 'Even', found: 'Odd'