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 ...
随机推荐
- linux中使用gdb调试程序
ref:https://blog.csdn.net/tenfyguo/article/details/8159176 一,什么是coredump 我们经常听到大家说到程序core掉了,需要定位解决, ...
- python之路(2)集合(set)和字符串格式化
目录 集合(set) 字符串的格式化(%和format) 集合(set) {‘a’,'b','c','d','e'} 定义:有不同元素组成的集合,集合的元素为不可变类型(数字,字符串,元组),集合是一 ...
- CSS iconfont阿里巴巴矢量图库在开发中实战使用
前言 项目开发中,是避免不了使用小图标的,那么国内比较好用的图标网站当属iconfont了,下面我们将详细介绍如何使用. iconfont选择所需图标 1.iconfont官网 2.把所需要的添加进入 ...
- [物理学与PDEs]第1章习题4 偶极子的极限电势
对在 $P_0$ 及 $P_1$ 处分别置放 $-q$ 及 $+q$ 的点电荷所形成的电偶极子, 其偶极距 ${\bf m}=q{\bf l}$, ${\bf l}=\vec{P_0P_1}$. 试证 ...
- gulp学习笔记——最好的学习文档是官网
官网:http://www.gulpjs.com.cn/docs/api/ 当然还有一个博客写的也很好,当我看不下去官网的时候,这个帮助了我很多,明了易懂:http://www.ydcss.com/a ...
- nnet3配置中的上下文和chunk(块)大小
Nnet3配置中的上下文和块大小 简介 本页讨论了nnet3配置中关于解码和训练的块大小以及左右上下文的某些术语.这将有助于理解一些脚本.目前,从脚本角度来看,没有任何关于nnet3的"概述 ...
- C#利用VUDP.cs开发网络通讯应用例程
VClassLib-CS项目Github地址:https://github.com/velscode/VClassLib-CS VUDP文档地址:https://github.com/velscode ...
- Django REST Framework API Guide 07
本节大纲 1.Permissions 2.Throttling Permissions 权限是用来授权或者拒绝用户访问API的不同部分的不同的类的.基础的权限划分 1.IsAuthenticated ...
- audio autoplay 是pause 不会停止播放
$("#alarmWav").append( $('<audio id="alarmAudio" autoplay loop src="../j ...
- Beta 冲刺(4/7)
目录 摘要 团队部分 个人部分 摘要 队名:小白吃 组长博客:hjj 作业博客:beta冲刺(4/7) 团队部分 后敬甲(组长) 过去两天完成了哪些任务 整理博客 ppt模板 接下来的计划 做好机动. ...