当前位置:网站首页>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可能因为没有那么严格,所以通过了
边栏推荐
- 内置模块10.18
- The valuation exceeds 15.6 billion yuan! Huaqin communication completed the round B financing of 1billion yuan! Qualcomm venture capital, Intel Capital led investment
- 下放三星3J1传感器:代码暗示Pixel 7人脸识别安全性将大增
- transformers-bert
- RadioGroup(单选框)
- Gesturedetector (gesture recognition)
- Session攻击
- 【深度学习基础知识 - 43】优势比的概念
- [basic knowledge of deep learning - 47] Bayesian networks and naive Bayes
- go-zero单体服务使用泛型简化注册Handler路由
猜你喜欢

Datepicker and TimePicker

Hyperledger caliper is built on fabric for performance test

BroadcastReceiver(广播)

Fileoutputstream (file storage) and FileInputStream (file reading)

JS event listening mouse keyboard form page onclick onkeydown onchange

Togglebutton (button switch)

【深度学习基础知识 - 45】机器学习中常用的距离计算方法

Arrayadapter (array adapter) and simpleadapter (simple adapter)

Complex number proof of solvability of regular 17 sided ruler and gauge drawing

IDEA:解决代码没有提示问题
随机推荐
JS find all nodes sibling childNodes children
It is said that Apple plans to buy some JDI factories with us $200million
[deep learning target detection series - 01] what is target detection
Arrayadapter (array adapter) and simpleadapter (simple adapter)
AutoCompleteTextView (input box pre match)
Application pool has been disabled
Detailed explanation of the underlying data structure of redis
【深度学习基础知识 - 41】深度学习快速入门学习资料
Marqueetextview (running lantern)
Sharepreference (storage)
Map和Set
[basic knowledge of deep learning - 50] PCA dimensionality reduction principal component analysis
Influxdb series (IV) TSM engine (storage principle)
SystemService(系统服务)
JS 事件监听 鼠标 键盘 表单 页面 onclick onkeydown onChange
Turn Hyper-V on and off
Summenudemo (submenu)
dp(动态规划)
JS event listening mouse keyboard form page onclick onkeydown onchange
GestureOverlayView(手势识别2)