Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LikesStatistic {
- public static void main(String[] args) {
- long likesCount = 102; // Input: any valid number of likes
- int registrationYear = 2013; // Input: any valid registration year
- int currentYear = java.time.Year.now().getValue();
- double likesPerYear = (double) likesCount / (currentYear + 1 - registrationYear); // Your formula
- System.out.println(likesPerYear + " likes / year");
- }
- }
Add Comment
Please, Sign In to add comment