Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package examen;
- import javax.swing.*;
- public class Examen {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- String a, b;
- int num=0, count=0, suma=0, prom;
- while (num%13!=0){
- a=JOptionPane.showInputDialog("Ingrese un nro");
- num=Integer.parseInt(a);
- suma=suma+num;
- count=count+1;
- }
- if (num<100){
- prom=suma/count;
- System.out.println("el promedio de los nros es"+prom+" ");
- }
- if (num>=100){
- System.out.println("la cantidad de nros ingresados fue"+count+" ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement