10_ for 练习 _ is Prime Number ?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Is Prime Number?</title>
</head>
<body>
<script type="text/javascript">
var xNumber = +prompt("请输入一个大于1的数字:");
var isPrimeNumber = true; if(xNumber>1 && xNumber != NaN)
{
for(i=2; i<xNumber; i++)
{
if(xNumber%i==0)
{
isPrimeNumber = false;
}
}
}
if(isPrimeNumber)
{
document.write(xNumber+" is a Prime Number.");
}
else
{
document.write(xNumber+" is NOT a Prime Number.");
}
</script>
</body>
</html>
10_ for 练习 _ is Prime Number ?的更多相关文章
- [Swift]LeetCode762. 二进制表示中质数个计算置位 | Prime Number of Set Bits in Binary Representation
Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime ...
- FZU 1649 Prime number or not米勒拉宾大素数判定方法。
C - Prime number or not Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & % ...
- 每日一九度之 题目1040:Prime Number
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:6732 解决:2738 题目描述: Output the k-th prime number. 输入: k≤10000 输出: The k- ...
- LintCode-Kth Prime Number.
Design an algorithm to find the kth number such that the only prime factors are 3, 5, and 7. The eli ...
- 10 001st prime number
这真是一个耗CPU的运算,怪不得现在因式分解和素数查找现在都用于加密运算. By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13 ...
- [LeetCode] Prime Number of Set Bits in Binary Representation 二进制表示中的非零位个数为质数
Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a prime ...
- C#_02.10_基础一_.NET框架
C#_02.10_基础一_.NET框架 一.概念: .NET框架是一个多语言组件开发和执行环境,它提供了一个跨语言的统一编程环境. 解读: 1..net框架是一个编程环境, 2.可以进行多语言的开发和 ...
- 762. Prime Number of Set Bits in Binary Representation二进制中有质数个1的数量
[抄题]: Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a ...
- LeetCode 762 Prime Number of Set Bits in Binary Representation 解题报告
题目要求 Given two integers L and R, find the count of numbers in the range [L, R] (inclusive) having a ...
随机推荐
- 巧用border制作箭头
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
- DirectX11 With Windows SDK--22 立方体映射:静态天空盒的读取与实现
前言 这一章我们主要学习由6个纹理所构成的立方体映射,以及用它来实现一个静态天空盒. 但是在此之前先要消除两个误区: 认为这一章的天空盒就是简单的在一个超大立方体的六个面内部贴上天空盒纹理: 认为天空 ...
- Node.js实战项目学习系列(4) node 对象(global、process进程、debug调试)
前言 在之前的课程我们学习了Node的模块化规则,接下来我们将学习下 Node的几个新特性:global ,process进程,debug调试 global 跟在浏览器中的window一样都是全局变量 ...
- bash 特殊变量
脚本参数 $* $@ $N shift 执行一个脚本时可以传递参数, 事实上每个参数都有对应的变量$0~$9 ./start.sh a b c $0 $1 $2 $3 当 ...
- 2017-2018-2 PDE 讨论班
等等. 第一次上课居然忘记怎么让笔记本电脑和投影仪相连了. 有两个接口. 一个在外面, 没用. 一个盖着了, 忘记翻开了.
- FineUIMvc 常见问题及解决办法
Ø 简介 FineUIMvc 是基于 jQuery 的专业 ASP.NET MVC/Core 控件库,本文主要介绍 FineUIMvc 的常见问题及解决办法. 1. View 中无法调用 Htm ...
- 2.12 for循环
for循环 像while循环一样,for可以完成循环的功能. 在Python中 for循环可以遍历任何序列的项目,如一个列表或者一个字符串等. for循环的格式 for 临时变量 in 列表或者字符串 ...
- win10下maven的安装与配置
下载apache-maven-3.5.3-bin.zip并解压: 环境配置: 系统环境:添加=>MAVEN_HOME 值为apache-maven-3.5.3的路径(D:\xxx\apache- ...
- 激活函数——tanh函数(理解)
0 - 定义 $tanh$是双曲函数中的一个,$tanh()$为双曲正切.在数学中,双曲正切“$tanh$”是由基本双曲函数双曲正弦和双曲余弦推导而来. $$tanhx=\frac{sinhx}{co ...
- 第二周 数据分析之展示 Matplotlib基础绘图函数实例
Pyplot基础图表函数 Pyplot饼图的绘制: Pyplot直方图的绘制: Pyplot极坐标图的绘制: Pyplot散点图的绘制: 单元小结: import numpy as np import ...