Created
February 4, 2018 06:02
-
-
Save TranNgocMinh/1e6c7b9645856e2ba3697f27d1aeb33e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class ... { | |
public static void main(String[] args) { | |
int i, S = 0; | |
Scanner scanner = new Scanner( System.in ); | |
System.out.print( "Nhap n = " ); | |
int n = Integer.parseInt( scanner.nextLine() ); | |
for(i =1; i<=n; i++) | |
S = S + i; | |
System.out.println("Tong la:" + S); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment