Language: Java



import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        int x,a,b,c;
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        x = sc.nextInt();
        int cnt=0;
        for(int i=0;i<=a;i++)
        {
            for(int j=0;j<=b;j++){
                int sum = i*500+j*

package main;

import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        int x,a,b,c;
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        c = sc.nextInt();
        x = sc.nextInt();
        int cnt=0;
        for(int i=0;i<=a;i++)
        {
            for(int j=0;j<=b;j++){
                int sum = i*500+j*100;
                if(sum==x)cnt++;
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
            }
        }
        
        System.out.println(cnt);
        
    }
}100;
                if(sum==x)cnt++;
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
            }
        }
        
        System.out.println(cnt);
        
    }
}

Compiler output:
Main.java:19: error: illegal start of expression
package main;
^
Main.java:19: error: not a statement
package main;
        ^
Main.java:21: error: illegal start of expression
import java.util.Scanner;
^
Main.java:21: error: not a statement
import java.util.Scanner;
                ^
Main.java:23: error: illegal start of expression
public class Main{
^
Main.java:44: error: illegal start of type
}100;
 ^
Main.java:45: error: illegal start of type
                if(sum==x)cnt++;
                ^
Main.java:45: error: <identifier> expected
                if(sum==x)cnt++;
                      ^
Main.java:45: error: <identifier> expected
                if(sum==x)cnt++;
                         ^
Main.java:45: error: <identifier> expected
                if(sum==x)cnt++;
                             ^
Main.java:46: error: illegal start of type
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                ^
Main.java:46: error: <identifier> expected
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                         ^
Main.java:46: error: <identifier> expected
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                             ^
Main.java:46: error: <identifier> expected
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                                 ^
Main.java:46: error: <identifier> expected
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                                     ^
Main.java:46: error: <identifier> expected
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                                                ^
Main.java:46: error: <identifier> expected
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                                                    ^
Main.java:46: error: <identifier> expected
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                                                           ^
Main.java:46: error: <identifier> expected
                else if(x>sum&&(x-sum)%50==0&&(x-sum)/50<=c)cnt++;
                                                               ^
Main.java:48: error: class, interface, enum, or record expected
        }
        ^
Main.java:52: error: class, interface, enum, or record expected
    }
    ^
21 errors