摘要: 算法竞赛入门 P82 5.4.2题目大意: 输入正整数n , 把n! =1*2*3*……*n 分解乘素因子相乘形式,并从大到小输出各个素数的指数。样例输入:553样例输出:5!= 3 1 153! = 49 23 12 8 4 4 3 2 2 1 1 1 1 1 1 1 1 /* 2 算法竞赛入门经典 P82 5.4.2 3 因子和阶乘 4 5 */ 6 7 #include 8 #include 9 10 //判断是否为素数11 int is_prime(int n)12 {13 for(int i=2;i*imaxp)maxp=j;56 ... 阅读全文
posted @ 2013-10-08 21:01 doubleshik 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 类型:计算几何 (算法竞赛入门经典 P88 几何计算题)题目:Problem EThe Other Two TreesInput:standard inputOutput:standard outputTime Limit:2 secondsYou have a quadrilateral shaped land whose opposite fences are of equal length. You have four neighbors whose lands are exactly adjacent to your four fences, thatmeansyou have ... 阅读全文
posted @ 2013-10-08 14:58 doubleshik 阅读(247) 评论(0) 推荐(0) 编辑