Witam
czy ktos ma pomysl jak w szybki i zgrabny sposob pozbyc sie ostatniego "plusa" z wyniku dzialania programu?
Czy da sie to zrobic w samym printf?
import java.util.Scanner;
public class Oof{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.printf("Podaj liczbe do ktorej ma sie obliczac: ");
int number = sc.nextInt();
System.out.printf("Podaj liczbe co ile ma isc: ");
int number2 = sc.nextInt();
long licznik = 0;
for(int i=1 ; i<number ; i+=number2){
System.out.printf("%d + ", i);
}
}
}