Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class primeiroPrograma{
- public static void main(String[] args) {
- int x;
- int y;
- int soma;
- int contador = 0;
- for(x = 100; x != -100; x--){
- for(y = -100; y != 100; y++){
- soma = x + y;
- if(soma == 100 | soma == -100){
- System.out.println(x);
- System.out.println(y);
- contador += 1;
- }
- }
- }
- System.out.println("Valores possiveis: " + contador);
- }
Advertisement
Add Comment
Please, Sign In to add comment