
csharp基础练习题:猫年,狗年【难度:0级】
csharp基础练习题:猫年,狗年【难度:0级】: 习题任务
我有一只猫和一只狗.
我让他们在同一时间,小猫/小狗.这是humanYears年前.
现在回到各自的年龄为[humanYears,catYears,dogYears]
笔记:
- humanYears> = 1
- humanYears仅整数
*15猫年,第一年 *+ 9猫年,第二年 *+ 4猫年后每年对于
狗年月*15狗年历第一年 *+ 9狗年第二年 *+ 5狗年后每年对于
** ** 引用
- www.catster/cats-101/calculate-cat-age-in-cat-years
- www.slate/articles/news_and_politics/explainer/2009/05/a_dogs_life.html
如果你喜欢这个习题还有另外一个相关的一个这里
编程目标: public class Dinglemouse { public static int[] humanYearsCatYearsDogYears(int humanYears) { // Your code here! return new int[]{0,0,0}; } } 测试样例: namespace Solution { using NUnit.Framework; using System; // TODO: Replace examples and use TDD development by writing your own tests [TestFixture] public class SolutionTest { public void One() { Assert.AreEqual(new int[]{1,15,15}, Dinglemouse.humanYearsCatYearsDogYears(1)); } [Test] public void Two() { 最佳答案(多种解法):点击查看答案
更多关联题目: 免责申明本博客所有编程题目及答案均收集自互联网,主要用于供网友学习参考,如有侵犯你的权益请联系管理员及时删除,谢谢 题目收集至www.codewars/ www.codewars/kata/cat-years-dog-years
👁️ 阅读量:0
© 版权声明:本文《csharp基础练习题:猫年,狗年【难度:0级】》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686511227a275399.html。