Task: | Kolikot |
Sender: | 21509 |
Submission time: | 2018-10-01 20:36:14 +0300 |
Language: | Java |
Status: | COMPILE ERROR |
Compiler report
input/kolikot.java:5: error: class Kolikot is public, should be declared in a file named Kolikot.java public class Kolikot { ^ 1 error
Code
import java.util.Scanner;import java.util.Arrays; public class Kolikot { static Scanner s = new Scanner(System.in); public static void main(String[] args) { int a =s.nextInt(); int g=1; int cf; int e = 0; while(true){ cf=((g+1)*((g+1)+1))/2; if(cf>=a){ break; } e=(g*(g+1))/2; g=1+g; } int[]f= new int[g]; int i=0; while(i+1<g){ f[i]=i+1;i++; } f[i]=a-g; System.out.println(Arrays.toString(f)); } }