摘要: 【题目描述】小明想试试运气去购买彩票,所以他开始研究彩票大乐透的玩法:超级大乐透是指由购买者从01—35共35个号码中选取5个号码为前区号码,并从01—12共12个号码中选取2个号码为后区号码组合为一注彩票进行的投注。每注金额人民币2元。小明打算用自己的零花钱去试试运气,选择了一组心目中的幸运数字, 阅读全文
posted @ 2016-06-17 12:48 Billw 阅读(965) 评论(0) 推荐(0) 编辑
摘要: 其中运用了最小公倍数与最大公约数乘积等于两数相乘的定理。 阅读全文
posted @ 2016-05-28 16:44 Billw 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 int main(int argc, char *argv[]) 3 { 4 int a,b,c; 5 scanf("%d %d",&a,&b); 6 while(b>0) 7 { 8 c=a%b; 9 a=b; 10 b=c; 11 } 12 print... 阅读全文
posted @ 2016-05-28 16:40 Billw 阅读(232) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ long a,b,c,d,e; scanf("%ld",&a); d=a; b=0; while(d>2) { d=d/2; b=b+1; } b=b-1; d=2; for(c=1;c<=b;c++) { d=d*2; } b=d*2; 阅读全文
posted @ 2016-05-28 16:25 Billw 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 终于打过CODEVS的青铜了^_^! 阅读全文
posted @ 2016-05-28 16:01 Billw 阅读(91) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>int main(){ int a,b; scanf("%d",&a); b=0; while(a) { b+=a%10; a/=10; } printf("%d\n",b); return 0;} 阅读全文
posted @ 2016-05-28 15:58 Billw 阅读(155) 评论(0) 推荐(0) 编辑