Skip to content

Instantly share code, notes, and snippets.

View TranNgocMinh's full-sized avatar

Ngoc Minh TranNgocMinh

View GitHub Profile
Scanner scanner = new Scanner( System.in );
boolean isTriangle = true;
char OK = 'Y';
float a,b,c;
do
{
System.out.print("Nhap a = ");
a = Float.parseFloat(scanner.nextLine() );
System.out.print("Nhap b = ");
b = Float.parseFloat(scanner.nextLine() );
bool isTriangle = true;
char OK = 'Y';
float a,b,c;
do
{
Console.WriteLine("Nhap a = ");
a = float.Parse(Console.ReadLine());
Console.WriteLine("Nhap b = ");
b = float.Parse(Console.ReadLine());
Console.WriteLine("Nhap c = ");
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
long number;
Scanner scanner = new Scanner( System.in );
System.out.print( "Nhap so he thap phan: " );
number = Long.parseLong(scanner.nextLine() );
System.out.println("Dang nhi phan la:" + binary(number));
class Program
{
static void Main(string[] args)
{
long number;
Console.WriteLine("Nhap so he thap phan: ");
number = long.Parse(Console.ReadLine());
Console.WriteLine("Dang nhi phan la:" + binary(number));
Console.ReadKey();
}
def Max(a,b):
max = 0
if a>b:
max=a
else:
max=b
return max
a = float(raw_input("Nhap so thu nhat:"))
b = float(raw_input("Nhap so thu hai:"))
print "So lon nhat la:",Max(a,b)
import java.util.Scanner;
public class Program {
public static void main(String[] args) {
float a,b;
Scanner scanner = new Scanner( System.in );
System.out.print( "Nhap a = " );
a = Float.parseFloat(scanner.nextLine() );
System.out.print( "Nhap b = " );
class Program
{
static void Main(string[] args)
{
float a, b;
Console.WriteLine("Nhap a = ");
a = float.Parse(Console.ReadLine());
Console.WriteLine("Nhap b = ");
b = float.Parse(Console.ReadLine());
Console.WriteLine("So lon nhat la:" + Max(a,b));
n = int(raw_input("Nhap n = "))
S = 0
for i in range(1,n+1):
S = S + i
print "Tong là:",S
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++)
int i, S = 0;
Console.WriteLine("Nhap n = ");
int n = int.Parse(Console.ReadLine());
for (i = 1; i <= n; i++)
S = S + i;
Console.WriteLine("Tong là:" + S);
Console.ReadKey();