Nathan Coulas

CCC '10 J1 - What is n, Daddy?

ccc10j1 JAVA8 06 Nov, 2019 1.455s 3 points

Source Code

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
         
            Scanner in = new Scanner(System.in);
            int a = in.nextInt();
            int b;
            int c;
            int counter = 0;
            
            c = a;
            b = 0;
            
            
            for(int i = 0; i < (a / 2) + 1; i++){
                
                if(c <= 5 && b <= 5){
                  //  System.out.println(a + " is " + b + " + " + c);
                    counter++;
                }
                
                b++;
                c--;
            }
                        System.out.println(counter);

 
    }
  
    
}