當前位置:編程學習大全網 - 編程軟體 - C語言解不等式的壹個編程問題,只要代碼

C語言解不等式的壹個編程問題,只要代碼

/*

2010 2011

18612 18623

5 10

12 29

q

Press any key to continue

*/

#include?<stdio.h>

#include?<math.h>

int?main()?{

double?n,nactor,sum,item;

int?a,b;

while(scanf("%d%d",&a,&b)?==?2)?{

nactor?=?1;

n?=?1;

sum?=?0;

item?=?1;

while(sum?<=?a)?{

sum?+=?item;

++n;

nactor?+=?1/n;

item?=?1/nactor;

}

printf("%g?",n);

while(sum?<=?b)?{

sum?+=?item;

++n;

nactor?+=?1/n;

item?=?1/nactor;

}

printf("%g\n",n);

}

return?0;

}

  • 上一篇:求這張圖紙數控編程,華中系統 ,選要那幾把刀?
  • 下一篇:如何讓多個div盒子並排同行
  • copyright 2024編程學習大全網