某人从2011年03月29日起开始“三天打鱼两天晒网”,问这个人在以后的某一天中是在“打鱼”,还是在“晒网”。,,输入一个日期如20110401#!/bin/bashread-p"Pleaseinputyourday:"daysec=`date-d"$day"+%s`if["0"!="$?"]thenecho"Itisinvaliddate"exit1fisecstart=`date-d20110329+%s`second=$((sec-secstart))if[$second-lt0]thenecho"Yourmustinputthedayafter2011-03-29!"exit2fimod=$(($second/60/60/24%5))if[$mod-lt3]thenecho"Fishing"exit0elseecho""fiexit0
三天打鱼天晒网 来自淘豆网m.daumloan.com转载请标明出处.