Skip to content

Instantly share code, notes, and snippets.

@hyperion0201
Created September 5, 2017 07:03
Show Gist options
  • Save hyperion0201/521dff569dd33b511d72b4582fe98447 to your computer and use it in GitHub Desktop.
Save hyperion0201/521dff569dd33b511d72b4582fe98447 to your computer and use it in GitHub Desktop.
Algorithm Int Spell based Vietnamese lang.
import java.util.*;
import javax.swing.*;
class SpellInt { // Class init
public static void Spell(int n) {
String str1, str2, str3, str4;
str1 = "ngan";
str2 = "tram";
str3 = "chuc";
str4 = "don vi";
int x, y, j, k;
x = n/1000;
y = (n%1000)/100;
j = (n%100)/10;
k = (n%100)%10;
String str = x + " " + str1 + " " + y + " " + str2 + " " + j + " " + str3 + " " + k + " " + str4;
JOptionPane.showMessageDialog(null, " Cach doc so vua nhap la : " + str);
}
public static void main(String[] args) {
String st = JOptionPane.showInputDialog(null, "Nhap so a = ");
int a = Integer.parseInt(st);
Spell(a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment