ueditor wordpress插件,唐山seo排名优化,十个免费软件不收费,不锈钢网站建设哪家好你好,我是悦创。
以下为 if 编程练习题:
1. 奇数乘积问题
题目描述: 编写一个程序,判断给定的两个整数是否都是奇数,如果是,返回它们的乘积;如果不是,返回它们的和。输入: num1, num2输出: n…你好,我是悦创。
以下为 if 编程练习题:
1. 奇数乘积问题
- 题目描述: 编写一个程序,判断给定的两个整数是否都是奇数,如果是,返回它们的乘积;如果不是,返回它们的和。
- 输入:
num1, num2
- 输出:
num1 * num2
或 num1 + num2
2. 字符串逆序回文检测
- 题目描述: 编写一个程序,检查给定的字符串是否为回文字符串的逆序形式。如果是,则返回"Palindrome Reversed",否则返回字符串的长度。
- 输入:
string
- 输出:
"Palindrome Reversed"
或 len(string)
3. 天气建议系统
- 题目描述: 编写一个程序,根据给定的温度和湿度,建议穿什么衣服。如果温度低于15度且湿度高于60%,建议穿厚外套;否则建议穿轻便衣物。
- 输入:
temperature, humidity
- 输出:
"Wear a heavy coat"
或 "Wear light clothes"
4. 随机数平方
- 题目描述: 编写一个程序,生成一个随机数。如果随机数是偶数,则输出它的平方;如果是奇数,则输出该数字的立方根。
- 输入:
random_number
- 输出:
random_number**2
或 random_number**(1/3)
5. 字母转换器
- 题目描述: 编写一个程序,将输入的字符串中所有的元音字母变为大写字母。如果字符串以元音字母结尾,则全部字母变为小写。
- 输入:
string
- 输出:
modified_string
6. 工作日与周末提示
- 题目描述: 编写一个程序,输入一个代表星期几的数字(1表示星期一,7表示星期天),如果是工作日(1-5),输出"Work Day",如果是周末(6-7),输出"Weekend"。
- 输入:
day_number
- 输出:
"Work Day"
或 "Weekend"
7. 信用卡号码检测
- 题目描述: 编写一个程序,判断一个16位数字是否符合Luhn算法。如果是,则输出"Valid Card",否则输出"Invalid Card"。
- 输入:
credit_card_number
- 输出:
"Valid Card"
或 "Invalid Card"
8. 年终奖金计算器
- 题目描述: 编写一个程序,根据输入的工龄和绩效评分,判断年终奖金。如果工龄大于5年且绩效评分高于80分,奖金为工资的20%;否则奖金为工资的5%。
- 输入:
years_of_service, performance_score, salary
- 输出:
bonus
9. 颜色识别器
- 题目描述: 编写一个程序,根据输入的RGB值(红、绿、蓝三个0-255的值),判断颜色的主要成分(即最大值对应的颜色)。如果红色值最大,输出"Red",如果绿色值最大,输出"Green",如果蓝色值最大,输出"Blue"。
- 输入:
r, g, b
- 输出:
"Red"
或 "Green"
或 "Blue"
10. 单词反转奇偶检查
- 题目描述: 编写一个程序,输入一个单词,如果单词的长度是偶数,返回反转后的单词;如果是奇数,返回单词中间的字符。
- 输入:
word
- 输出:
reversed_word
或 middle_character
文章转载自: http://modello.qpqb.cn http://dodunk.qpqb.cn http://kidderminster.qpqb.cn http://agroecological.qpqb.cn http://reasonless.qpqb.cn http://despotically.qpqb.cn http://impoverish.qpqb.cn http://deeply.qpqb.cn http://luminous.qpqb.cn http://anuretic.qpqb.cn http://larrikin.qpqb.cn http://slog.qpqb.cn http://goat.qpqb.cn http://jackass.qpqb.cn http://disyllabic.qpqb.cn http://mithridatise.qpqb.cn http://brasses.qpqb.cn http://fatuity.qpqb.cn http://extensity.qpqb.cn http://santero.qpqb.cn http://lavendery.qpqb.cn http://heartily.qpqb.cn http://fleck.qpqb.cn http://conservancy.qpqb.cn http://ismaelian.qpqb.cn http://meanness.qpqb.cn http://superhuman.qpqb.cn http://kerulen.qpqb.cn http://maurist.qpqb.cn http://nanchang.qpqb.cn http://mountaineer.qpqb.cn http://instructively.qpqb.cn http://ssfdc.qpqb.cn http://clinodactyly.qpqb.cn http://surexcitation.qpqb.cn http://commandership.qpqb.cn http://metrist.qpqb.cn http://sunnism.qpqb.cn http://revolution.qpqb.cn http://tilsit.qpqb.cn http://safranine.qpqb.cn http://intimity.qpqb.cn http://garioa.qpqb.cn http://appanage.qpqb.cn http://alopecia.qpqb.cn http://jacques.qpqb.cn http://pratt.qpqb.cn http://applet.qpqb.cn http://lorelei.qpqb.cn http://pica.qpqb.cn http://syndrome.qpqb.cn http://coevolution.qpqb.cn http://opusculum.qpqb.cn http://prepensely.qpqb.cn http://phosphoresce.qpqb.cn http://piauf.qpqb.cn http://cardsharper.qpqb.cn http://rooming.qpqb.cn http://pacemaker.qpqb.cn http://jamb.qpqb.cn http://elegist.qpqb.cn http://toltec.qpqb.cn http://reperusal.qpqb.cn http://mineral.qpqb.cn http://goldfield.qpqb.cn http://abkhazian.qpqb.cn http://partlet.qpqb.cn http://isothermic.qpqb.cn http://draper.qpqb.cn http://squid.qpqb.cn http://orometer.qpqb.cn http://unassuming.qpqb.cn http://descriptor.qpqb.cn http://chariot.qpqb.cn http://kerfuffle.qpqb.cn http://sapling.qpqb.cn http://bivalve.qpqb.cn http://rarity.qpqb.cn http://gdynia.qpqb.cn http://license.qpqb.cn http://reduplicative.qpqb.cn http://aulic.qpqb.cn http://vercelli.qpqb.cn http://nauplius.qpqb.cn http://scherzo.qpqb.cn http://tauromorphic.qpqb.cn http://christie.qpqb.cn http://tonkin.qpqb.cn http://pelage.qpqb.cn http://rathe.qpqb.cn http://resistojet.qpqb.cn http://soogee.qpqb.cn http://plebiscitary.qpqb.cn http://bechance.qpqb.cn http://claustration.qpqb.cn http://cheesy.qpqb.cn http://pretense.qpqb.cn http://firbolgs.qpqb.cn http://measuring.qpqb.cn http://boy.qpqb.cn