fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. /* <-- Deadfish Interpreted Computer Language --> */
  13. /* <-- Programmed by Jonathan Todd Skinner --> */
  14.  
  15. /* <-- Include Header File --> */
  16. /* Updated the Code to Remove Uneeded Header Includes - JTS */
  17. #include <stdio.h>
  18.  
  19. /* <-- Declare some variables --> */
  20. unsigned int x; /* make a positive integer and call it x */
  21. char usrinput; /* string to hold user input */
  22.  
  23. /* <-- Declare a function --> */
  24. void entercommand(void);
  25.  
  26. /* <-- Start Main Function --> */
  27. int main(void)
  28. {
  29. /* At beginning of x is always 0 */
  30. x = 0;
  31. entercommand();
  32. }
  33.  
  34. /* <-- Enter Command --> */
  35. void entercommand(void)
  36. {
  37. /* Accept User Input */
  38. printf(">> "); /* output shell symbol */
  39. scanf("%c",&usrinput); /* scan for user input that is char */
  40. /* Check for commands and do action */
  41. /* Make sure x is not greater then 256 */
  42. if(x == 256) x = 0;
  43. if(x == -1) x = 0;
  44. if(usrinput == 'i')
  45. {
  46. x++;
  47. entercommand();
  48. }
  49. else if(usrinput == 'd')
  50. {
  51. x--;
  52. entercommand();
  53. }
  54. else if(usrinput == 'o')
  55. {
  56. printf("%d\n",x);
  57. entercommand();
  58. }
  59. else if(usrinput == 's')
  60. {
  61. x=x*x;
  62. entercommand();
  63. }
  64. else
  65. {
  66. printf("\n");
  67. entercommand();
  68. }
  69.  
  70. }
  71. }
  72. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:17: error: illegal character: '#'
#include <stdio.h>
^
Main.java:20: error: ';' expected
unsigned int x; /* make a positive integer and call it x */
        ^
Main.java:24: error: illegal start of expression
void entercommand(void);
^
Main.java:24: error: ';' expected
void entercommand(void);
                 ^
Main.java:24: error: illegal start of expression
void entercommand(void);
                  ^
Main.java:24: error: ';' expected
void entercommand(void);
                      ^
Main.java:27: error: ';' expected
int main(void)
        ^
Main.java:27: error: illegal start of expression
int main(void)
         ^
Main.java:27: error: ';' expected
int main(void)
             ^
Main.java:35: error: illegal start of expression
void entercommand(void)
^
Main.java:35: error: ';' expected
void entercommand(void)
                 ^
Main.java:35: error: illegal start of expression
void entercommand(void)
                  ^
Main.java:35: error: ';' expected
void entercommand(void)
                      ^
Main.java:39: error: illegal start of expression
	scanf("%c",&usrinput); /* scan for user input that is char */
	           ^
14 errors
stdout
Standard output is empty