Created
May 13, 2023 18:33
-
-
Save modos/3badffcbae47ab878e1352b24341005c to your computer and use it in GitHub Desktop.
مدیریت زمان نیما
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
var w, s, i int | |
fmt.Scan(&w, &s, &i) | |
total_time := w + s // تعداد کل ساعات کار و درس | |
overlap_time := i | |
if i > w { | |
overlap_time = w | |
} | |
if overlap_time > s { | |
overlap_time = s | |
} | |
rest_time := 24 - total_time + overlap_time // محاسبه تعداد ساعات استراحت | |
fmt.Println(rest_time) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment