fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. string traducir(int n)
  5. {
  6. switch(n)
  7. {
  8. case 0:
  9. return "cero";
  10. case 1:
  11. return "uno";
  12. case 2:
  13. return "dos";
  14. case 3:
  15. return "tres";
  16. case 4:
  17. return "cuatro";
  18. case 5:
  19. return "cinco";
  20. case 6:
  21. return "seis";
  22. case 7:
  23. return "siete";
  24. case 8:
  25. return "ocho";
  26. case 9:
  27. return "nueve";
  28. case 10:
  29. return "diez";
  30. case 11:
  31. return "once";
  32. case 12:
  33. return "doce";
  34. case 13:
  35. return "trece";
  36. case 14:
  37. return "catorce";
  38. case 15:
  39. return "quince";
  40. case 16:
  41. return "dieciséis";
  42. case 17:
  43. return "diecisiete";
  44. case 18:
  45. return "dieciocho";
  46. case 19:
  47. return "diecinueve";
  48. case 20:
  49. return "veinte";
  50. case 30:
  51. return "treinta";
  52. case 40:
  53. return "cuarenta";
  54. case 50:
  55. return "cincuenta";
  56. case 60:
  57. return "sesenta";
  58. case 70:
  59. return "setenta";
  60. case 80:
  61. return "ochenta";
  62. case 90:
  63. return "noventa";
  64. case 100:
  65. return "cien";
  66. case 200:
  67. return "doscientos";
  68. case 300:
  69. return "trecientos";
  70. case 400:
  71. return "cuatrocientos";
  72. case 500:
  73. return "quinientos";
  74. case 600:
  75. return "seicientos";
  76. case 700:
  77. return "setecientos";
  78. case 800:
  79. return "ochocientos";
  80. case 900:
  81. return "novecientos";
  82. case 1000:
  83. return "mil";
  84. default:
  85. return " ";
  86. }
  87.  
  88. }
  89.  
  90. int main ()
  91. {
  92. bool listos=false;
  93. int n;
  94.  
  95. while (!listos)
  96. {
  97. cout<<"Escriba un número máximo de 6 cifras"<<"\n";
  98. cin>>n;
  99.  
  100. if (n==-1)
  101. {
  102. listos=true;
  103. }
  104. else
  105. {
  106. if (((n%10==0)||(n<20))&&(n<=100))
  107. {
  108. cout<<traducir(n)<<"\n";
  109. }
  110. }
  111. }
  112. }
  113. public static void main (String[] args) throws java.lang.Exception
  114. {
  115. // your code goes here
  116. }
  117. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:1: error: class, interface, or enum expected
#include <iostream>
         ^
Main.java:4: error: class, interface, or enum expected
string traducir(int n)
^
Main.java:10: error: class, interface, or enum expected
  case 1:
  ^
Main.java:12: error: class, interface, or enum expected
  case 2:
  ^
Main.java:14: error: class, interface, or enum expected
  case 3:
  ^
Main.java:16: error: class, interface, or enum expected
  case 4:
  ^
Main.java:18: error: class, interface, or enum expected
  case 5:
  ^
Main.java:20: error: class, interface, or enum expected
  case 6:
  ^
Main.java:22: error: class, interface, or enum expected
  case 7:
  ^
Main.java:24: error: class, interface, or enum expected
  case 8:
  ^
Main.java:26: error: class, interface, or enum expected
  case 9:
  ^
Main.java:28: error: class, interface, or enum expected
  case 10:
  ^
Main.java:30: error: class, interface, or enum expected
  case 11:
  ^
Main.java:32: error: class, interface, or enum expected
  case 12:
  ^
Main.java:34: error: class, interface, or enum expected
  case 13:
  ^
Main.java:36: error: class, interface, or enum expected
  case 14:
  ^
Main.java:38: error: class, interface, or enum expected
  case 15:
  ^
Main.java:40: error: class, interface, or enum expected
  case 16:
  ^
Main.java:42: error: class, interface, or enum expected
  case 17:
  ^
Main.java:44: error: class, interface, or enum expected
  case 18:
  ^
Main.java:46: error: class, interface, or enum expected
  case 19:
  ^
Main.java:48: error: class, interface, or enum expected
  case 20:
  ^
Main.java:50: error: class, interface, or enum expected
  case 30:
  ^
Main.java:52: error: class, interface, or enum expected
  case 40:
  ^
Main.java:54: error: class, interface, or enum expected
  case 50:
  ^
Main.java:56: error: class, interface, or enum expected
  case 60:
  ^
Main.java:58: error: class, interface, or enum expected
  case 70:
  ^
Main.java:60: error: class, interface, or enum expected
  case 80:
  ^
Main.java:62: error: class, interface, or enum expected
  case 90:
  ^
Main.java:64: error: class, interface, or enum expected
  case 100:
  ^
Main.java:66: error: class, interface, or enum expected
  case 200:
  ^
Main.java:68: error: class, interface, or enum expected
  case 300:
  ^
Main.java:70: error: class, interface, or enum expected
  case 400:
  ^
Main.java:72: error: class, interface, or enum expected
  case 500:
  ^
Main.java:74: error: class, interface, or enum expected
  case 600:
  ^
Main.java:76: error: class, interface, or enum expected
  case 700:
  ^
Main.java:78: error: class, interface, or enum expected
  case 800:
  ^
Main.java:80: error: class, interface, or enum expected
  case 900:
  ^
Main.java:82: error: class, interface, or enum expected
  case 1000:
  ^
Main.java:84: error: class, interface, or enum expected
  default:
         ^
Main.java:86: error: class, interface, or enum expected
  }
  ^
Main.java:93: error: class, interface, or enum expected
    int n;
    ^
Main.java:95: error: class, interface, or enum expected
    while (!listos)
    ^
Main.java:98: error: class, interface, or enum expected
        cin>>n;
        ^
Main.java:100: error: class, interface, or enum expected
        if (n==-1)
        ^
Main.java:103: error: class, interface, or enum expected
        }
        ^
Main.java:109: error: class, interface, or enum expected
            }
            ^
Main.java:113: error: class, interface, or enum expected
	public static void main (String[] args) throws java.lang.Exception
	              ^
49 errors
stdout
Standard output is empty