我一直在努力学习编程,所以我一直在努力创建一个简单的程序,它将两个数字作为输入,并计算最低的公共倍数.我在Python中这样做是因为我不知道如何在Java中输入.现在发生的事情是,在我输入数字后程序就会挂起,没有任何反应.这里的任何指针将不胜感激.谢谢.
#LCM Calculator
#Author: Ethan Houston
#Language: Python
#Date: 2013-12-27
#Function: Program takes 2 numbers as input, and finds the lowest number
# that goes into each of them
def lcmCalculator(one, two):
""" takes two numbers as input, computes a number that evenly
divides both numbers """
counter = 2 #this is the number that the program tried to divide each number by.
#it increases by 1 if it doesn't divide evenly with both numbers.
while True:
if one % …Run Code Online (Sandbox Code Playgroud) 我有一个程序将使用 Javascript 使用“document.write()”将值“打印”到屏幕上。打印的值是一个整数。我希望能够使用 CSS 将样式应用于正在打印的这个整数。下面是我尝试做的一些截断的示例代码,但它不起作用(程序只是退出:
var number = 5 //just for an example
document.write('<p id="jstext"' + number + '</p>')
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的 CSS 代码:
#jstext {
text-align: center;
font-size: 90px;
}
Run Code Online (Sandbox Code Playgroud)
谢谢
css ×1
function ×1
html ×1
if-statement ×1
javascript ×1
lcm ×1
printing ×1
python ×1
while-loop ×1