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 ...
随机推荐
- PyQt5之布局管理
目录 一 写在开头 1.1 本文内容 二 绝对布局 三 布局类 3.1 水平布局(QHBoxLayout)和垂直布局(QVBoxLayout) 3.2 水平布局和垂直布局实例 3.3 网格布局(QGr ...
- django - 总结 - 中间件
中间件顾名思义,是介于request与response处理之间的一道处理过程,相对比较轻量级,并且在全局上改变django的输入与输出.因为改变的是全局,所以需要谨慎实用,用不好会影响到性能. MID ...
- spring+springMVC+mybatis简单整合
spring+springMVC+mybatis简单整合, springMVC框架是spring的子项目,所以框架的整合方式为,spring+Mybatis或springMVC+mybatis. 三大 ...
- secureCRT免密码登陆Linux
转自:http://blog.csdn.net/wangquannetwork/article/details/46062675 1.实现原理: 通过CRT生成的密钥对,把公钥上传到Linux服务器指 ...
- Oracle 关键字、高级函数的使用
1.序列.唯一标识 查询时,可以添加递增序列 rownum 表的数据每一行都有一个唯一的标识 rowid 2.函数 单行:查询多条数据 如:to_date() 多行:查询总结数据,一般用于group ...
- XML,json,ajax
一.XML 1.概述:XML全称为Extensible Markup Language, 意思是可扩展的标记语言 2.版本:W3C在1998年2月发布1.0版本:W3C在2004年2月发布1.1版本, ...
- 论文阅读笔记:《Contextual String Embeddings for Sequence Labeling》
文章引起我关注的主要原因是在CoNLL03 NER的F1值超过BERT达到了93.09左右,名副其实的state-of-art.考虑到BERT训练的数据量和参数量都极大,而该文方法只用一个GPU训了一 ...
- NB-IoT不一定最完美 但足以成为决定ofo与摩拜物联网胜负的关键【转】
转自:http://news.rfidworld.com.cn/2017_11/3d5ed5c5d8cb9949.html 2018年到来之前,如果还不懂物联网,你会被淘汰. 今年1月,工信部< ...
- Mysql -- 外键的变种 三种关系
一.介绍 因为有foreign key的约束, 使得两张表形成了三种关系 多对一 多对多 一对一 二.如果找出两张表之间的关系 #.先站在左表的角度去找 是否左表的多条记录可以对应右 ...
- jxl应用事例
实例中主要目的是解析jxl使用流程以及jxl绘制Excel的写法思路,代码掩去了项目中的真实数据,请根据需求酌情修改,如果有帮助到有需要的人,不胜欢喜. Dao层为查询数据库,返回list数据,此处省 ...