计算机科学系 [英] computer science department

查看:114
本文介绍了计算机科学系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



用c ++写一个程序来计算当天生日的剩余天数


write a program in c++ to calculate the remaining days of my birthday in current days

推荐答案

我们不做你的作业:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!


这里的人肯定不会做你的功课......但是为了让你开始,这里的问题已经破了,现在去搞清楚

1.将您的生日作为输入

2.获取上述输入,将日期计算为年份编号,例如每年的第205天...

3.然后检查,使用上面的编号和当前编号的日期(即今天的日期与编号的日期相符),无论您是否已超过生日日期或尚未出现。

4 。这之后简单地返回值,这将是你的答案



我正在帮你做一些时间,即使我害怕编码,但让我要清楚,HANDS ON让你完美如此代码......:D



我希望其他人不要生我的气帮助他完成家庭作业...
WELL people here certainly dont do your homework...but to get you started,here is the problem broken,now go figure it out
1.get your birthday as input
2.taking the above input,calculate the date as numbered day of year eg like 205 th day of year...
3.then check,using above number and current numbered day(i.e today''s date convereted to numbered day of year) whether you have passed your birthday date or it is yet to appear.
4.after this simply return the value,which will be your answer

Well i''m helping you cause some time back even i was afraid of coding,but let me be clear,HANDS ON makes you perfect so code...:D

I hope other guys wont be angry on me for helping him with his homework...


你的任务中只有两个棘手的细节,即
There are just two tricky details in you task, namely
  1. 环绕。
  2. 闰年。



为了简单起见,让我们假设当时没有包裹或闰年的情况发生,只有一个数组(每月几天)和简单的操作你可能很容易找到结果。


For simplicity, let''s suppose that neither wrap around nor leap year case is happening then, with just an array (days per month) and simple operations you may easily find the result.


这篇关于计算机科学系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆