Startup and Tech
Friday, 31 July 2020
Codeforces 617A Solution - Elephant Solution In Java
Program
import java.util.*; public class x { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int sum=0; sum = sum+ n/5; n = n%5; sum =sum+ n/4; n = n%4; sum = sum+n/3; n = n%3; sum = sum+n/2; n = n%2; sum = sum+n/1; n = n%1; System.out.println(sum); } }
Output
I/P: ---- 5 ---- O/P: ---- 1
Codeforces 160A Solution - Twins Solution In Java
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment