C语言逻辑思维练题一
要求:用java实现下面的所有题目,
2012年11月1日提交分支类
2012年11月2日-3日提交循环类
严禁抄袭
分支类:
编写程序,输入一个整数,打印出它是奇数还是偶数
键盘上输入两个数字,求其中最大值并输出。
输入华氏温度,要求输出摄氏温度,公式为: c=5(f-3 2)/9
编制程序,任意输入两个整数,求这两个整数之差的绝对值并输出输出某一年份。判断该年份是否为闰年。(判断闰年的条件为下面二者之一:能被4整除,但不能被100整除。或者能被400整除。)(作为作业)
输入年月日,输出该天是该年中的第几天。
例如输入 2003 年 1 月 5 日,则输出是第 5 天。
例如输入 2000 年 3 月 10 日,则输出是第 70 天。
注意二月份天数的计算
循环类:
第一类:数字计算类
1>.求1+2+3+….+100
2>.求1*3*5*…*10
3>.求1!+2!+3!+…+20!
4>.求1-1/2+1/3-1/4+1/5+…-1/100
第二类:打印图形
第三类:数字判断类
1>.找出100 到1000之间的素数
2>.找出100 到1000之间的水仙花数
(所谓“水仙花数”是指一个3位数,其各位数字立方和等于该数本身。如:153 = 13+53+33)
3>. 1000以内的完数
(某自然数除它本身以外的所有因子之和等于该数,则该数被称为完数
equipment requirements, facilitate the introduction of cables and ducts. 6.2.9 outdoor cabinets, make appropriate rain cover. 6.3 for the Cabinet fixed the leg bolts should use the original Cabinet. 6.3.1 electrical distribution cabinets should be welded without special instructions, weld enclosure bottom corners, with base length in 20mm-40mm, welding should be solid, welding in the welding parts with preservatives. 6.3.2 electrical power
equipment requirements, facilitate the introduction of cables and ducts. 6.2.9 outdoor cabinets, make appropriate rain cover. 6.3 for the Cabinet fixed the leg bolts should use the original Cabinet. 6.3.1 electrical distribution cabinets should be welded without special instructions, weld enclosure bottom corners, with base length in 20mm-40mm, welding should be solid, welding in the welding parts with preservatives. 6.3.2 electrical power
equipment requirements, facilitate the introduction of cables and ducts. 6.2.9 outdoor cabinets, make appropriate rain cover. 6.3 for the Cabinet fixed the leg bolts should use the original Cabinet. 6.3.1 electrical distribution cabinets should be welded without special instructions, weld enclosure bottom corners, with base length in 20mm-40mm, welding should be solid, welding in the welding parts with preservatives. 6.3.2 electrical power