使用C中的控制指令进行实践需要解决的问题



需要一些学生可以想到的好问题,并应用他们自己的逻辑来解决这些问题,只使用控制指令。到目前为止,所涉及的主题都是基本的,甚至阵列还没有完成。但是,我希望学生在进入更高的话题之前做到完美。

我试着搜索一些示例问题,没有一个是我所期望的/它们是我已经知道的。

其中一些我知道:

  1. 编写一个程序,在不使用内置函数的情况下找出a^b的值
  2. 编写一个程序,找出一个范围内的阿姆斯特朗数
  3. 编写一个程序,以相反的顺序打印数字的二进制等价物(因为数组还没有完成,所以只需要简单的逻辑来打印余数并进一步除以数字)
  4. 对用户输入的所有-ve、+ve和0进行计数,直到用户希望终止程序为止
  5. 编写一个程序来显示给定数字的所有除数
  6. 编写一个程序来确定给定的数字是否为素数
  7. 检查给定的数字是奇数还是偶数

需要更多逻辑上有趣的问题,帮助学生培养解决问题的能力。

谢谢。

附言:如果这个问题含糊其辞或没有切中要害,请原谅我,因为这个问题有很多答案,我想我不能接受一个答案?

  • 检查数字是否为回文(1234554321)
  • 使用write()重写函数以在控制台中打印数字(类似于printf("%d", ...)
  • 一个函数,用于写入从12到89的两个数字的所有组合,不允许两个相同的数字,也不允许不同的顺序(12, 13, ..., 19, 23, 24...:跳过21,因为它是用12完成的)
  • 一种函数,用相同的规则(不使用数组)写入n个数字的所有组合(n作为从1到9的参数给定)
Print first 33 terms of Fibonacci-Series
Write factorial of n being input from keyboard on console.
Find hours,minutes,seconds from given seconds.(305 s = 5m + 5s ....)
Calculate dot-product and cross-product of two 2D vectors.
Find the intersecting point of two lines(m=slope, (x0,y0)=a point for each line)
Calculate sin(pi/4) with using series expansion
Print the minimum of values given from keyboard on screen.
Simulate **and** , **or** and **xor** gates.
Find projection of a vector(3D) on another vector. 
Find area of a polygon(2D)
Calculate the integral of x-square between x=0 and x=3 using integration by trapezoidal rule

Find roots of: (x-square) plus (two times x) plus (one) equals (zero)

最新更新