Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Sum-of-a-series/Java/sum-of-a-series.java
Normal file
15
Task/Sum-of-a-series/Java/sum-of-a-series.java
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
public class Sum{
|
||||
public static double f(double x){
|
||||
return 1/(x*x);
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
double start = 1;
|
||||
double end = 1000;
|
||||
double sum = 0;
|
||||
|
||||
for(double x = start;x <= end;x++) sum += f(x);
|
||||
|
||||
System.out.println("Sum of f(x) from " + start + " to " + end +" is " + sum);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue