Created
December 22, 2015 01:58
-
-
Save peter279k/f155ca9b6f4578722ac7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class main{ | |
public static void main(String[] args) { | |
Scanner input = new Scanner(System.in); | |
int count = 1; | |
while(input.hasNext()) { | |
long m = input.nextLong(); | |
System.out.printf("%4d.", count); | |
bangla(m); | |
if(m == 0) | |
System.out.print(" " + m); | |
System.out.println(); | |
count += 1; | |
} | |
} | |
public static void bangla(long number) { | |
String res = ""; | |
if(number >= 10000000) { | |
bangla(number / 10000000); | |
System.out.print(" kuti"); | |
number %= 10000000; | |
} | |
if(number >= 100000) { | |
bangla(number / 100000); | |
System.out.print(" lakh"); | |
number %= 100000; | |
} | |
if(number >= 1000) { | |
bangla(number / 1000); | |
System.out.print(" hajar"); | |
number %= 1000; | |
} | |
if(number >= 100) { | |
bangla(number / 100); | |
System.out.print(" shata"); | |
number %= 100; | |
} | |
if(number != 0) { | |
System.out.print(" " + number); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment