質問編集履歴
1
文の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -98,18 +98,38 @@
|
|
98
98
|
|
99
99
|
}
|
100
100
|
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
__________________________________
|
104
102
|
|
105
103
|
|
106
104
|
|
107
|
-
|
105
|
+
package Task6;
|
108
106
|
|
109
107
|
|
110
108
|
|
109
|
+
public class NaturalNumber implements mylib.iSequence
|
110
|
+
|
111
|
+
{
|
112
|
+
|
111
|
-
|
113
|
+
public double get(int n)
|
114
|
+
|
115
|
+
{
|
116
|
+
|
117
|
+
return n;
|
118
|
+
|
119
|
+
}
|
120
|
+
|
121
|
+
public static void main(String[] args)
|
122
|
+
|
123
|
+
{
|
124
|
+
|
125
|
+
mylib.iSequence seq = new NaturalNumber();
|
126
|
+
|
127
|
+
double sum_seq = mylib.SeqUtils.sum(seq, 100);
|
128
|
+
|
129
|
+
System.out.println("1から100までの和は"+sum_seq+"です");
|
130
|
+
|
131
|
+
}
|
112
132
|
|
113
133
|
|
114
134
|
|
115
|
-
|
135
|
+
}
|