Академический Документы
Профессиональный Документы
Культура Документы
import java.awt.Component;
import javax.swing.JOptionPane;
public class NumberWords2
{
static String rawInput;
static String output = "";
static int hold;
if(input == 0)
{
output += "Zero";
}
else if(input < 10)
{
output += ones(0);
}
else if(input < 20)
{
output += teens(0);
}
else if(input < 100)
{
output += tens(0);
output += ones(1);
}
else if(input < 1000)
{
output += hundreds(0);
int temp = Integer.parseInt(rawInput.substring(1,3));
if(temp > 10 && temp < 20)
{
output += teens(2);
}
else
{
output += tens(1);
output += ones(2);
}
}
else if(input < 10000)
{
output += thousands(0);
output += hundreds(1);
int temp = Integer.parseInt(rawInput.substring(2,4));
if(temp > 10 && temp < 20)
{
output += teens(3);
}
else
{
output += tens(2);
output += ones(3);
}