New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
输入和输出个数不一样,测试用例怎么写啊? #348
Comments
第一个数是循环次数,没有对应的输出。怎么办? |
没懂啥意思,没啥没输出 |
这是题目的问题吧... 我觉得你来错地方了,应该去找那个OJ的管理员 |
我是在自己写题目自己测试,还不太懂这个 OJ 的判定机制。不会写这个程序的测试用例。试了几次,怎么写都会判断成错的。 |
就是 |
我就是 OJ 的管理员,以前没弄过,刚开始了解。 |
我觉得您可以先了解一下如何出题。 这是正确的样例: [input]
2
2
6
[output]
1
0 |
第一次我就是这么写的,结果是”Wrong Answer",附上我的用例。 |
就是上面一开始的程序,写个能跑对的测试用例好难,我都试了 20 次了没有写对。 |
您的程序也有问题,在 Linux 环境下,换行符是 下面是修正后的程序: #include <stdio.h>
int main() {
int n;
int k;
scanf("%d", &n);
while (n--) {
int i = 2;
scanf("%d", &k);
while (i <= k) {
if (k % i == 0) {
if (k != i) {
printf("%d\n", 0);
break;
} else {
printf("%d\n", 1);
}
}
i++;
}
}
} |
啊!就是这个问题,对了!对了!终于对了! |
附上例程
The text was updated successfully, but these errors were encountered: