c语言入门经典英文版,c语言入门经典100道程序编辑(国外英文资料).doc

c语言入门经典100道程序编辑(国外英文资料)

c语言入门经典100道程序编辑(国外英文资料)

Problem: an integer, plus 100 is a perfect square, plus 168 is another perfect square. What is the number?

Program analysis: judgment within 100000, the first number plus 100 before prescribing, then the number plus 268 before prescribing, if the results of prescribing satisfy the following conditions, which is the result. See the analysis:

Program source code:

H # include "math."

The main ()

{

Long int I, x, y, z;

For (I = 1; I < 100000; I + +)

{x = SQRT (I + 100); / * x is equal to the result after 100

Y = SQRT (I + 268); / * y is equal to the result after 168

If (x * x = = = = I + 100 & y = = = I + 268)

/ * if the square root of a number is equal to that number, this means that this number is perfect square

Printf (\ n % ld \ n, I);

}

}

Question: 1, 2, 3, 4 Numbers, how many different and no duplicate digits can be made? How much is?

Program analysis: in the hundreds, the tens place, the ones digit is 1, 2, 3, 4. Make up all the permutations and then remove the ones that don't meet the criteria.

Program source code:

The main ()

{

Int I, j, k;

Printf (" \ n ");

For (I = 1; I < 5; I + +) / * below is the triple loop * /

For (j = 1; j < 5; j + +)

(k = 1; k < 5; k + +)

{

If (I! = k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k)/(= k) /

Printf (" % d, % d, % d \ n ", I, j, k);

}

}

Problem: an integer, plus 100 is a perfect square, plus 168 is another perfect square. What is the number?

Program analysis: judgment within 100000, the first number plus 100 before prescribing, then the number plus 268 before prescribing, if the results of prescribing satisfy the following conditions, which is the result. See the analysis:

Program source code:

H # include "math."

The main ()

{

Long int I, x, y, z;

For (I = 1; I < 100000; I + +)

{x = SQRT (I + 100); / * x is equal to the result after 100

Y = SQRT (I + 268); / * y is equal to the result after 168

If (x * x = = = = I + 100 & y = = = I + 268)

/ * if the square root of a nu

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值