package suma; import java.util.Scanner; public class Main { public Main() { } static void lecturadatos(int b)throws MiExcepcion { if (b!=2 && b!=8 && b!=16) throw new MiExcepcion( "Solo bases:2, 8 o 16!!!" ); } static void valoresnumericos(String n, int b)throws MiExcepcion { switch (b) { case 2: for (int k=0;k<n.length();k++) if (n.charAt(k)!='0' && n.charAt(k)!='1') throw new MiExcepcion( "No es Binario!!!" ); break; case 8: for (int k=0;k<n.length();k++) if (n.charAt(k)!='0' && n.charAt(k)!='1' && n.charAt(k)!='2' && n.charAt(k)!='3' && n.charAt(k)!='4' && n.charAt(k)!='5' && n.charAt(k)!='6' && n.charAt(k)!='7') throw new MiExcepcion( "No es Octal!!!" ); break; case 16: for (int k=0;k<n.length();k++) if (n.charAt(k)!='0' && n.charAt(k)!='1' && n.charAt(k)!='2' && n.charAt(k)!='3' && n.charAt(k)!='4' && n.charAt(k)!='5' && n.charAt(k)!='6' && n.charAt(k)!='7' && n.charAt(k)!='8' && n.charAt(k)!='9' && n.charAt(k)!='a'