算法
HengShanLiQiang
软件学生
展开
-
oj错题记录(持续更新)
一、 原来的代码 #include<iostream> using namespace std; int main(){ int num;//需要判断的数字 bool a,b,c,d;//四人喜欢与否 bool property1 = (num%2==0); bool property2 = (num>4&&num<=12);//两个性质 cin>>num; a = property1&原创 2020-10-20 15:43:21 · 235 阅读 · 0 评论 -
Apples Prologue灵性算法
Apples Prologue灵性算法 今天刷oj的时候碰到了这题 简单是很简单,但有几个坑: t==0,能吃的苹果比现有苹果多,s能不能整除t 下面是我的算法,已AC #include<iostream> using namespace std; int main(){ int m,t,s;//m个苹果,吃一个需t分钟,过去了s分钟 int num_apple_remain;//剩余完整苹果数 cin>>m>>t>>s;原创 2020-10-20 12:07:18 · 313 阅读 · 0 评论