/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
// calcular el número de dolares d
// calcular el número de centavos c
// visualizar d y c
// mod(c,100) un tipo de método
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Scanner lectura
= new Scanner
(System.
in); System.
out.
println ("Entra el número de centavos: "); int c= lectura.nextInt();
int d= dolar(c); //c / 100;
int cent= centavo(c); //c % 100;
mostrar("Dólares:$", d);
mostrar("Centávos:¢", cent);
}
public static int dolar (int c){
return c/100;
} // end método dolar
public static int centavo (int c){
return c%100;
} // end método centavo
public static void mostrar
(String mensaje,
double var
){ System.
out.
println(mensaje
+ var
); } // end método mostrar
}
CgoKCi8qIHBhY2thZ2Ugd2hhdGV2ZXI7IC8vIGRvbid0IHBsYWNlIHBhY2thZ2UgbmFtZSEgKi8KCmltcG9ydCBqYXZhLnV0aWwuKjsKaW1wb3J0IGphdmEubGFuZy4qOwppbXBvcnQgamF2YS5pby4qOwoKLy8gY2FsY3VsYXIgZWwgbsO6bWVybyBkZSBkb2xhcmVzIGQKLy8gY2FsY3VsYXIgZWwgbsO6bWVybyBkZSBjZW50YXZvcyBjCi8vIHZpc3VhbGl6YXIgZCB5IGMKLy8gbW9kKGMsMTAwKSB1biB0aXBvIGRlIG3DqXRvZG8KCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU2Nhbm5lciBsZWN0dXJhID0gbmV3IFNjYW5uZXIgKFN5c3RlbS5pbik7CgkJU3lzdGVtLm91dC5wcmludGxuICgiRW50cmEgZWwgbsO6bWVybyBkZSBjZW50YXZvczogIik7CgkJaW50IGM9IGxlY3R1cmEubmV4dEludCgpOwoJCQoJCWlud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