Fast Power 原题链接:http://lintcode.com/en/problem/fast-power/#Calculate the an% b where a, b and n are all 32bit integers.ExampleFor 231 % 3 = 2For 10010...
分类:
其他好文 时间:
2014-12-19 23:22:09
阅读次数:
241
#include#includeint prime(int n){ int i; if(n=sqrt(n)){ printf("素数:%d\n",n); return 1; } }void main(){ int i,n,count=0; while(1){ printf("请输入一个整数:"...
分类:
编程语言 时间:
2014-12-19 21:52:58
阅读次数:
253
质数(prime number)又称素数,除了1和它本身外,不能整除以其他自然数,换句话说就是该数除了1和它本身以外不再有其他的因数;否则称为合数。最小的质数是2。要判断一个整数N是不是质数很简单,看它是否能被2到sqrt(N)之间的整数整除即可。def isPrime(n): if n%2=...
分类:
其他好文 时间:
2014-12-19 20:31:07
阅读次数:
129
#include#includeint prime(int n){ int i; if(n=sqrt(n)){ printf("%d是素数!\n",n); return 0; }}void main(){ int n; while(1){ printf("请输入一个数字:"); scanf("...
分类:
编程语言 时间:
2014-12-18 22:01:16
阅读次数:
227
Exercise 5-1. Write a program that will read five values of type double from the keyboardand store them in an array. Calculate the reciprocal of each ...
分类:
其他好文 时间:
2014-12-18 20:26:11
阅读次数:
518
先占个坑。。。 Description:http://acm.swust.edu.cn/problem/0002/
分类:
其他好文 时间:
2014-12-18 15:05:46
阅读次数:
90
Exercise 3-3. Write a program that will calculate the price for a quantity entered from the keyboard, given that the unit price is $5 and there is a d...
分类:
其他好文 时间:
2014-12-17 23:53:57
阅读次数:
174
首先声明本文所讲的范围,在这篇文章中,是采用synopsys的设计流程,对数字电路进行功耗分析,生成功耗分析报告的流程。分析的对象是逻辑综合之后布局布线之前的功耗分析,以及布局布线之后的功耗分析。 Synopsys做功耗分析使用到的工具是:Primetime PX, Prime Rail。PTPX可...
分类:
其他好文 时间:
2014-12-16 18:30:23
阅读次数:
428
题目描述:A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two ad...
分类:
其他好文 时间:
2014-12-16 17:00:52
阅读次数:
207
两天和作一天吧只要是作 prime 算法的实现,作用是找一个图的最小生成树,用的是列表void Prim( ListMatrix *G, int start )/* * 寻找一某一点为核心的最佳布线 * 即使用prime最小生成树 */ { struct{ ...
分类:
其他好文 时间:
2014-12-12 22:02:40
阅读次数:
197