Taking average of user input number

前端 未结 3 1751
走了就别回头了
走了就别回头了 2021-01-28 04:06

This is my code

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

public class eCheck10A
{
public static void main(String[] args)
{
  PrintStream out = System.out;
  Scanne         


        
3条回答
  •  执念已碎
    2021-01-28 04:56

    Another way to do running average is:
    new_average = old_average + (new_number - old_average ) / count
    If you ever hit max for a variable type, you would appreciate this formula.

提交回复
热议问题