Жалуется
invalid method declaration; return type required:
Solution.java, line: 28, column: 19
Спасибо заранее
package com.javarush.task.task05.task0507;
import java.io.*;
/*
Среднее арифметическое
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
double sum = 0.0;
boolean check = false;
int b=0;
while (!check)
{
int a=Integer.parseInt(reader.readLine());
fight(a)=b;
sum+=b/2;
check=(a==-1);
}
System.out.println(sum);
//напишите тут ваш код
}
public static fight(int c) {
if (c<0)
{
return -c;
}
else
{
return c;
}
}
}