Skip to content

Instantly share code, notes, and snippets.

View godie007's full-sized avatar

Diego Fernando Echevery godie007

View GitHub Profile
public class trabajoClase {
public static void main(String[] args) {
String num = "1234";
String cadenaInv;
for (int i = num.length(); i >= 0; i--) {
cadenaInv = "invertidos: " + num.charAt(i);
System.out.println(cadenaInv);
}
}
}
public class Ensayo {
public static void main(String[] args) {
String inv = "";
System.out.println(convertir("1234", inv));
}
public static String convertir(String num,String inv) {
for (int i = num.length() - 1; i >= 0; i--) {
inv += num.charAt(i);
}return inv;
}
import javax.swing.JOptionPane;
public class Ejercicio1 {
public static void main(String[] args) {
int contador = 0;
int contador2 = 0;
int importe = 0;
int users = Integer.parseInt(JOptionPane.showInputDialog("Numero de Usuarios"));
for (int i = 0; i < users; i++) {
import javax.swing.JOptionPane;
public class Ejercicio1 {
private static int metodo(int a) {
int b = 0;
for (int i = 1; i <= a; i++) {
int mod = i*3;
b += mod;
}return b;
public class TrabajoClase {
public static void main(String[] args) {
System.out.println(convertir("123"));
}
public static String convertir(String s) {
String num = "";
for (int i = s.length() - 1; i >= 0; i--) {
num += s.charAt(i);
}return num;
import javax.swing.JOptionPane;
public class Calc2 {
public static void main(String[] args) {
int f = Integer.parseInt(JOptionPane.showInputDialog("A"));
int g = Integer.parseInt(JOptionPane.showInputDialog("A"));
int a;
int b;
String contador = "";
if (f<g) {
a = f;
public class Calc {
public static void main(String[] args) {
int[] fila = new int[100];
fila[0]=3;
fila[1]=3;
int suma = fila[0]+fila[1];
System.out.println("a: "+suma);
}
}
public class Calc {
public static void main(String[] args) {
// declaramos y construimos un arreglo con una capacidad de diez números
// enteros
int[] arreglo = new int[10];
// asignamos los valores para cada posición en el arreglo...
arreglo[0] = 100;
arreglo[1] = 200;
arreglo[2] = 300;
arreglo[3] = 400;
public class Calc {
public static void main(String[] args) {
// declaramos y construimos un arreglo con una capacidad de diez números
// enteros
int[] arreglo = new int[10];
// asignamos los valores para cada posición en el arreglo...
arreglo[0] = 100;
arreglo[1] = 200;
arreglo[2] = 300;
arreglo[3] = 400;
package Trabajo;
import javax.swing.JOptionPane;
//Main
public class Proyecto {
public static void main(String[] args) {
int operacion = Integer.parseInt(JOptionPane.showInputDialog("Ingrese una opcion \n"
+ "1-Suma \n"
+ "2-Resta \n"
+ "3-Multiplicacion"));