鸡兔同笼问题

阅读 57

2022-03-18

#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

#include <math.h>

int main(void)

{

 int x, y;

 for (x = 1; x <= 97; x++) {

  y = 98 - x;

 

  if ( 2*x + 4*y == 386){

   printf("鸡有%d只,兔有%d只", x, y);

 }

 }

 return 0;

}

这是我在CSDN上的第二篇博客,我是大一新生,对计算机特别感兴趣,但是自己的编程技术,不好。

精彩评论(0)

0 0 举报