Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //1 задание
- let daysToBirthday = 31+28+31+30+31+30+18
- let secondsToBirthday = 60*60*24*daysToBirthday
- print(secondsToBirthday)
- //2 задание
- let mouthsToBirthday = 7
- let daysIn1Quarter = 31+28+31
- let daysIn2Quarter = daysIn1Quarter + 30 + 31 + 30
- let daysIn3Quarter = daysIn2Quarter + 31 + 31 + 30
- let daysIn4Quarter = daysIn3Quarter + 31 + 30 + 31
- if daysToBirthday <= daysIn1Quarter {
- print("I was born in the first quarter")
- } else if daysToBirthday <= daysIn2Quarter {
- print("I was born in the second quarter")
- } else if daysToBirthday <= daysIn3Quarter {
- print("I was born in the third quarter")
- } else {
- print("I was born in the fourth quarter")
- }
- let myQurter = mouthsToBirthday/3 + 1
- print("I was born in the \(myQurter) quarter")
- //4 задание
- let posistion = (x: 3, y: 7)
- if (posistion.x + posistion.y) % 2 == 0 {
- print("You are on the black cage")
- } else {
- print("You are on the white cage")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement