Language: Java

#include<stdio.h>
  int push(int);
  int pop(void);
  int stack[100];
  int stack_size=0;
int main(){
  char s[100];

  scanf("%[^\n]*s",s);
  printf("%s=%d\n",s,calc(s));
  return 0;
}

int pop(){
  if(stack_size<=0)
    return 0;
  else
    return stack[--stack_size];
}

int push(int n){
  stack[stack_size++]=n;
}

int get_number(char *s){
  int flag=0, n=0;

  if(*s=='+')
    s++;
  else if(*s=='-')
    flag=1;
    s++;

    while(*s>='0'&&*s<='9'){
      n=n*10+(*s-'0');
      s++;
    }
    
    if(flag)
      return -n;
    return n;
}

int judge(char *s){
  if(*s=='+' || *s=='-'){
    s++;
    if(*s>='0' &&*s<='9')
      return 1;
    return 0;
  }
  if(*s>='0'&&*s<='9')
    return 1;
  return 0;
}
int calc(char *s){
  int a,b,n;
  while(*s){
    if(judge(s)){
	n=get_number(s);
	push(n);
	while(*s=='+'||*s=='+'){
	  s++;
	}
	while(n){
	  n=n/10;
	  s++;
	}
    }
    else{
      switch(*s){
	
      case '+':
	a=pop();
	b=pop();
	push(b+a);
	break;

      case '-':
	a=pop();
	b=pop();
	push(b-a);
	break;

      case '*':
	a=pop();
	b=pop();
	push(b*a);
	break;
      }
      s++;
    }
  }
  return pop();
}

	



Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
  int pop(void);
  ^
  (use --enable-preview to enable unnamed classes)
Main.java:3: error: <identifier> expected
  int pop(void);
              ^
Main.java:4: error: class, interface, enum, or record expected
  int stack[100];
  ^
Main.java:7: error: ']' expected
  char s[100];
         ^
Main.java:25: error: <identifier> expected
int get_number(char *s){
                   ^
Main.java:28: error: illegal start of expression
  if(*s=='+')
     ^
Main.java:30: error: illegal start of expression
  else if(*s=='-')
          ^
Main.java:34: error: illegal start of expression
    while(*s>='0'&&*s<='9'){
          ^
Main.java:34: error: illegal start of expression
    while(*s>='0'&&*s<='9'){
                   ^
Main.java:35: error: illegal start of expression
      n=n*10+(*s-'0');
              ^
Main.java:44: error: <identifier> expected
int judge(char *s){
              ^
Main.java:45: error: illegal start of expression
  if(*s=='+' || *s=='-'){
     ^
Main.java:45: error: illegal start of expression
  if(*s=='+' || *s=='-'){
                ^
Main.java:47: error: illegal start of expression
    if(*s>='0' &&*s<='9')
       ^
Main.java:47: error: illegal start of expression
    if(*s>='0' &&*s<='9')
                 ^
Main.java:51: error: illegal start of expression
  if(*s>='0'&&*s<='9')
     ^
Main.java:51: error: illegal start of expression
  if(*s>='0'&&*s<='9')
              ^
Main.java:55: error: <identifier> expected
int calc(char *s){
             ^
Main.java:57: error: illegal start of expression
  while(*s){
        ^
Main.java:61: error: illegal start of expression
	while(*s=='+'||*s=='+'){
	      ^
Main.java:61: error: illegal start of expression
	while(*s=='+'||*s=='+'){
	               ^
Main.java:70: error: illegal start of expression
      switch(*s){
             ^
24 errors