The print statement prints each number, but does not add them up although it should
int total =+ n;
package com.codegym.task.task05.task0529;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
while (true) {
String s = buffer.readLine();
if (s.equals("sum")){
break;
} else {
int n = Integer.parseInt(s);
int total =+ n;
System.out.println(total);}
}
}
}