Pabl0o0

Untitled

Nov 29th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public class Something {
  2.  
  3. public static double funkcja(int liczbaPoczatkowa, int N) {
  4. double result = 0;
  5.  
  6. for (int i = 0; i < N; i++) {
  7. result += Math.pow(liczbaPoczatkowa,2) - 2 * liczbaPoczatkowa + 1.5;
  8. liczbaPoczatkowa++;
  9. }
  10. return result;
  11. }
  12.  
  13. public static void main(String[] args) {
  14.  
  15. System.out.format("%.3f%n",funkcja(1,3));
  16.  
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment