Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var firstStart, secondStart, firstDiff, secondDiff int
- fmt.Scanln(&firstStart)
- fmt.Scanln(&secondStart)
- fmt.Scanln(&firstDiff)
- fmt.Scanln(&secondDiff)
- for i := firstStart; i <= firstStart + firstDiff; i++ {
- for j := secondStart; j <= secondStart + secondDiff; j++ {
- var isFirstPrime = true
- var isSecondPrime = true
- for k := 2; k <= int(math.Sqrt(float64(i))); k++ {
- if i % k == 0 {
- isFirstPrime = false
- break
- }
- }
- for k := 2; k <= int(math.Sqrt(float64(j))); k++ {
- if j % k == 0 {
- isSecondPrime = false
- break
- }
- }
- if isFirstPrime && isSecondPrime {
- fmt.Printf("%d%d\n", i, j)
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement