当前位置:网站首页>Online Judge 输出超限
Online Judge 输出超限
2022-07-27 17:15:00 【Aldersw】
在OJ里输出超限只会是循环输出没有结束,因为现实的错误有另外一个时间超限

这是问题,下面是我的问题代码
#include <stdio.h>
int leap(int a)
{ int r;
if(a%100)
{
if(a%4==0)r=1;
else r=0;
}
else if(a%400==0)r=1;
else r=0;
return r;
}
int main()
{
int a,b,c,days;
int tep[12]={0,31,59,90,120,151,181,212,243,273,304,334};
while(scanf("%d %d %d",&a,&b,&c)!=0)
{
if(leap(a))
{
if(b>2)tep[b-1]+=1;
days=tep[b-1]+c;
}
else
days=tep[b-1]+c;
printf("%d\n",days);
}
return 0;
}这个代码在vc++6.0上运行没有任何问题,但是在OJ上运行显示输出超限
原因是因为在while语句中,是=0,而不是=EOF;
VC可能因为没有那么严格,所以通过了
边栏推荐
- GestureDetector(手势识别)
- VirtualBox: set shared folder
- Count the six weapons of the domestic interface cooperation platform!
- Transaction log full problem handling in sqlserver 2008
- The valuation exceeds 15.6 billion yuan! Huaqin communication completed the round B financing of 1billion yuan! Qualcomm venture capital, Intel Capital led investment
- 真实案例,大学生接单被骗,希望大家不要被骗了【惨痛教训】
- 全局函数
- 【深度学习基础知识 - 45】机器学习中常用的距离计算方法
- Intel releases horse ridge chip: 22nm process, which can control multiple qubits
- Come to sword finger offer 03. Repeated numbers in the array
猜你喜欢
随机推荐
I want to consult. Our maxcompute spark program needs to access redis, development environment and production environment redis
Publish your own NPM component library
JS 寻找所有节点sibling childNodes children
王牌代码静态测试工具Helix QAC 2022.2中的新增功能(2)
File operation protection
VirtualBox: set shared folder
GestureDetector(手势识别)
【日常积累 - 07】cuda多版本切换
The go zero singleton service uses generics to simplify the registration of handler routes
【深度学习基础知识 - 41】深度学习快速入门学习资料
AutoCompleteTextView(输入框预匹配)
[basic knowledge of deep learning - 50] PCA dimensionality reduction principal component analysis
黑客入门教程(非常详细)从零基础入门到精通,看完这一篇就够了。
ArrayAdapter(数组适配器)与SimpleAdapter(简单适配器)
TSMC 5nm is about to mass produce: Apple A14 monopolizes 70% of the production capacity, and Huawei Kirin 1020 takes 30%
[basic knowledge of deep learning - 44] the method of realizing multiple classification by logistic regression
IDEA:解决代码没有提示问题
Use of jvisualvm
Application pool has been disabled
DatePicker(日期选择器)与TimePicker(时间选择器)



![[RCTF2015]EasySQL-1|SQL注入](/img/69/aa1fc60ecf9a0702d35d876e8c3dda.png)





