JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

A05鸡兔同笼

发布时间 2023-03-22 21:12:57作者: 缕一缕清风

public class A05鸡兔同笼 {
public static void main(String[] args) {
// 鸡兔同笼,鸡的数量是兔子的4倍,总的脚数是396,问鸡兔各有多少只?
int j; // j表示鸡
for (int i = 0; i < 396 / 4; i++) { // i表示兔子
j = 4 * i;
if (i * 4 + j * 2 == 396) {
System.out.println("鸡:" + j + "兔子:" + i);
break;
}
}
}
}

    本栏目推荐文章
  • 寒假生活指导05
  • 05_OLED调试工具
  • A connection was successfully established with the server but then an error
  • 《RAPL: A Relation-Aware Prototype Learning Approach for Few-Shot Document-Level Relation Extraction》阅读笔记
  • 2024-01-13 Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. ==》引用了未使用的方法导致
  • mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; ERROR 1410 (42000): You are not allowed to create a user with GRANT
  • 05-契约精神与海纳百川
  • 寒假生活指导05
  • dlv调试时访问不可达函数报错please use a line with a statement
  • 读元宇宙改变一切笔记05_计算
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们