Advertisement
guidecastro

Conjectura Goldbach?!

Apr 13th, 2014
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. int NumeroPar = 0, cont, acumulador = 0;
  2.  
  3. Console.WriteLine("\nDigite um numero par maior que 2: ");
  4. NumeroPar = int.Parse(Console.ReadLine());
  5.  
  6. if (NumeroPar >= 4)
  7. {
  8. for (cont = NumeroPar - 1; cont <= NumeroPar; NumeroPar--)
  9. {
  10. cont = NumeroPar - 1;
  11. if (NumeroPar % cont > 0)
  12. {
  13. acumulador += cont;
  14. Console.WriteLine("\nA soma de: " + acumulador + " = " + NumeroPar);
  15. }
  16.  
  17. }
  18. }
  19. else
  20. Console.WriteLine("\nNúmero inválido, digite um número par maior que 2!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement