fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.text.*;
  5. import java.lang.*;
  6. import java.io.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. private static String[] suffix = new String[] {"crka", "crki", "crke"};
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. for (int i = 0 ; i != 5 ; i++) {
  15. System.out.print(i+" ");
  16. System.out.println(String.format("V besedilu je %d %s ", i, suffix[Math.min(i, 2)]));
  17. }
  18. }
  19. }
Success #stdin #stdout 0.1s 320320KB
stdin
Standard input is empty
stdout
0 V besedilu je 0 crka 
1 V besedilu je 1 crki 
2 V besedilu je 2 crke 
3 V besedilu je 3 crke 
4 V besedilu je 4 crke