Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Something {
- public static double funkcja(int liczbaPoczatkowa, int N) {
- double result = 0;
- for (int i = 0; i < N; i++) {
- result += Math.pow(liczbaPoczatkowa,2) - 2 * liczbaPoczatkowa + 1.5;
- liczbaPoczatkowa++;
- }
- return result;
- }
- public static void main(String[] args) {
- System.out.format("%.3f%n",funkcja(1,3));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment