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
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() ); |
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
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 = "); |
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 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)); |
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
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(); | |
} |
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
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) |
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 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 = " ); |
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
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)); |
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
n = int(raw_input("Nhap n = ")) | |
S = 0 | |
for i in range(1,n+1): | |
S = S + i | |
print "Tong là:",S |
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++) |
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
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(); |