Advertisement
mazarafa

PrimoGemeos

Dec 18th, 2019
636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.77 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func main() {
  8.     //var valor int = -10
  9.     //var primo bool = "true"
  10.     var x int
  11.     var y int  
  12.     //var total int
  13.     fmt.Print("Informe o numero:")
  14.     fmt.Scanf("%d %d\n", &x, &y)
  15.    
  16.     for i:=x; i < y+1; i++{
  17.         //primo = true
  18.         for j:=2; j < i; j++{
  19.             if (i%j == 0){
  20.                 //primo = false
  21.                 break
  22.             };
  23.  
  24.         };
  25.         // if(i-valor == 2){
  26.         //  fmt.Print(valor, i)
  27.         //  valor = i
  28.  
  29.  
  30.         // }
  31.     }
  32. }
  33. ////////// versão em python
  34.  
  35. //valor = -10
  36. //a = int(input())
  37. //b = int(input())
  38. //for num in range(a,b+1):
  39.  //   primo = True
  40.    // for div in range(2,num):
  41.       //  if num%div == 0:
  42.         //    primo = False
  43.           //  break
  44.     //if primo:
  45.    //     if(num-valor == 2):
  46.       //      print(valor,num)
  47.         //valor = num
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement