Skip to content

Commit

Permalink
feat(4.1.5.2): Finish U4_L1_5_Activity_Two
Browse files Browse the repository at this point in the history
  • Loading branch information
101zh committed Oct 25, 2023
1 parent 9b820c4 commit 134ec5f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/Unit4/U4_L1_5_Activity_Two.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package Unit4;

import java.util.Scanner;

public class U4_L1_5_Activity_Two {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

int n=scanner.nextInt();
int index=0;
int sum=0;
while (index<n){
index++;
sum+=index;
}

System.out.println(sum);
scanner.close();
}
}

0 comments on commit 134ec5f

Please sign in to comment.