12345678910111213141516171819 |
-
- /**
- * Write a description of class SumOfInput here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class SumOfInput
- {
- public int sumOfInput(int n)
- {
- int sum = 0;
- for (int i=n; i>=1; i--){
- sum += i;
- }
- return sum;
- }
- }
|