- 博客(2)
- 收藏
- 关注
原创 判断输入年月日 是当前年份的第几天(shell)
判断日期在这一年的第几天脚本内容如下:#!/bin/bash## filename: panduandijitianecho "Please input year month day.(以空格隔开年、月、日 如:2000 4 3)"read year month daycase $month in 1) sum=0 ;; 2) sum=31 ;; 3) sum=59 ;; 4) sum=90 ;; 5) sum=120 ;...
2021-12-09 20:45:53
570
原创 使用shell脚本输出“水仙花数”
"水仙花数"是指一个3位数,其各位数字立方和等于该数本身。#!/bin/bash## filename:shuixianhuashu.shecho "\"水仙花数\"是指一个3位数,其各位数字立方和等于该数本身。"for (( i=100; i<=999; i++ ))do a=i/100 b=(i/10)%10 c=i%10 if (( a*a*a + b*b*b + c*c*c == i )) then...
2021-12-09 20:36:10
3595
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人