Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var n, salary int
- fmt.Scanln(&n)
- fmt.Scanln(&salary)
- var apps string
- for i := 0; i < n && salary > 0; i++ {
- fmt.Scanln(&apps)
- if apps == "Facebook" {
- salary -= 150
- } else if apps == "Instagram" {
- salary -= 100
- } else if apps == "Reddit" {
- salary -= 50
- }
- }
- if salary <= 0 {
- fmt.Println("You have lost your salary.")
- } else {
- fmt.Println(salary)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement