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
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 |
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
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, |
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
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() |
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
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 = "); |
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
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 = "); |
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
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) | |
else: | |
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'): |
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
fun main(args: Array<String>) { | |
var OK = 'Y' | |
do { | |
print("Nhap a = ") | |
var a = readLine()!!.toInt() | |
print("Nhap b = ") | |
var b = readLine()!!.toInt() | |
if(a==0) | |
print("Phuong trinh ${a}x + $b = 0 vo nghiem") | |
else { |
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 binary(number): | |
base = 1 | |
binary_val = 0 | |
while(number > 0): | |
rem = number%2 | |
binary_val = binary_val + rem*base | |
number = number/2 | |
base = base*10 | |
return binary_val | |
number = long(raw_input("Nhap so he thap phan:")) |
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
<html> | |
<head> | |
<title>First Mobile Example</title> | |
<meta name="viewport" content="width=device-width, initialscale=1"> | |
<link rel="stylesheet" href="jquery.mobile-1.4.5.css" /> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> | |
<script type="text/javascript" src="jquery.mobile-1.4.5.min.js"></script> | |
</head> | |
<body> | |
<div data-role="page" id="homePage"> |