Skip to content

Instantly share code, notes, and snippets.

Ngoc Minh TranNgocMinh

Block or report user

Report or block TranNgocMinh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
while True:
a = int(raw_input("Nhap a="))
b = int(raw_input("Nhap b="))
if(a is 0):
print "Phuong trinh %dx + %d = 0 vo nghiem."%(a,b)
x = -b/(a*1.0)
print "Phuong trinh %dx + %d = 0 co nghiem x = %.2f"%(a,b,x)
OK = raw_input("Ban co muon tiep tuc?(Y/N)")
if (OK is 'N'):
public static void main(String[] args) {
Scanner scanner = new Scanner( );
char OK = 'Y';
int a,b;
double x;
System.out.print("Nhap a = ");
a = Integer.parseInt(scanner.nextLine() );
System.out.print("Nhap b = ");
View CodeList_7_CSharp.cs
static void Main(string[] args)
char OK = 'Y';
int a, b;
double x;
Console.WriteLine("Nhap a = ");
a = int.Parse(Console.ReadLine());
Console.WriteLine("Nhap b = ");
View CodeList_6_Kotlin.kt
fun main(args: Array<String>) {
var isTriangle = true
var OK = 'Y'
do {
print("Nhap a = ")
var a = readLine()!!.toFloat()
print("Nhap b = ")
var b = readLine()!!.toFloat()
print("Nhap c = ")
var c = readLine()!!.toFloat()
View CodeList_5_Kotlin.kt
fun main(args: Array<String>) {
print("Nhap so he thap phan:")
var number = readLine()!!.toLong()
var binary = binary(number)
print("Dang nhi phan la: $binary")
fun binary( _number:Long):Long{
// Function parameters in Kotlin are read-only val's inside the function,
// so _number here will always refer to the original object that was passed in.
// If you need to modify what it points to while your function is running,
View CodeList_4_Kotlin.kt
fun main(args: Array<String>) {
print("Nhap so thu nhat:")
var a = readLine()!!.toFloat()
print("Nhap so thu hai:")
var b = readLine()!!.toFloat()
var max = Max(a,b)
print("So lon nhat la: $max")
fun Max(a:Float,b:Float):Float{
var max:Float = 0.0f
View CodeList_3_Kotlin.kt
fun main(args: Array<String>) {
var S = 0
print("Nhap n = ")
var n = readLine()!!.toInt()
for(i in 1..n)
print("Tong la: $S")
View CodeList_2_Kotlin.kt
fun main(args: Array<String>) {
println("Nhap so thu nhat: ")
var num1 = readLine()!!.toInt()
println("Nhap so thu hai: ")
var num2 = readLine()!!.toInt()
var Total = num1 + num2
println("Tong là: $Total")
View CodeList_1_Kotlin.kt
fun main(args: Array<String>) {
print("Hello World!")
isTriangle = True
OK = 'Y'
while True:
a = float(raw_input("Nhap a="))
b = float(raw_input("Nhap b="))
c = float(raw_input("Nhap c="))
if(a<=0 or b<=0 or c<=0):
isTriangle = False
if((a + b <= c) or (a + c <= b) or (b + c <= a)):
isTriangle = False
You can’t perform that action at this time.