This file contains hidden or 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
main() { | |
List temp = ["20C", "30C", "50F", "40C", "23F"]; | |
for (var i in temp) { | |
if (i[2] == "C") { | |
var a = (i[0]+i[1]); | |
var c = int.parse (a); | |
double f =c*9/5+32; | |
print ('F=$f'); | |
} |
This file contains hidden or 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 "dart:html"; | |
GtoB(num g){ | |
return g*2.2046; | |
} | |
BtoG(num b){ | |
return b*0.4536; | |
} | |
main() { | |
InputElement tempInput = querySelector("#temp"); | |
querySelector("#submit").onClick.listen((e) => convert(tempInput.value)); |
This file contains hidden or 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
GtoB(num g){ | |
return g*2.2046; | |
} | |
BtoG(num b){ | |
return b*0.4536; | |
} | |
main(){ | |
var type; | |
int len; | |
var number; |
This file contains hidden or 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
//在F設置華氏溫度 | |
int C=32; | |
num F=(5/9)*(C-32); | |
num G=F*C; | |
main(){ | |
print ("華氏$C度等於攝氏$F度"); | |
} |
This file contains hidden or 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
//在F設置攝氏溫度 | |
int F=0; | |
num C=F*(9/5)+32; | |
num G=F*C; | |
main(){ | |
print ("攝氏$F度等於華氏$C度"); | |
} |
This file contains hidden or 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
void main() { | |
for (int i = 0; i < 5; i++) { | |
print('hello $i'); | |
} | |
print('hello 中文'); | |
} |
This file contains hidden or 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
void main() { | |
print("hello world"); | |
} |