Skip to content

Instantly share code, notes, and snippets.

@modos
Created May 13, 2023 18:33
Show Gist options
  • Save modos/3badffcbae47ab878e1352b24341005c to your computer and use it in GitHub Desktop.
Save modos/3badffcbae47ab878e1352b24341005c to your computer and use it in GitHub Desktop.
مدیریت زمان نیما
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