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
View CodeList_7_Java.java
public static void main(String[] args) {
Scanner scanner = new Scanner( System.in );
char OK = 'Y';
int a,b;
double x;
do
{
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;
do
{
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)
S=S+i
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!")
}
View CodeList_6_Python.py
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
View CodeList_6_Java.java
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() );
You can’t perform that action at this time.