摘要: 俄罗斯乘法是一种计算两数相乘的算法。举例如下:计算 35*72过程35 7217 1448 2884 5762 11521 2304从上到下,对每一行,若左边的数字若为奇数,则将右边的数字取出,累加。72+144+2304=2520累加的结果2520即为乘积。因为该算法不需要已知九九乘法表。所以在计... 阅读全文
posted @ 2015-04-07 23:04 夏弥 阅读(617) 评论(0) 推荐(0) 编辑
摘要: 2808 校门外的树 1 #include 2 using namespace std; 3 int main() 4 { 5 int a[10001]={0}; 6 int m,i,l,r,L,num=0; 7 cin>>L>>m; 8 while(m--)... 阅读全文
posted @ 2015-04-02 22:18 夏弥 阅读(84) 评论(0) 推荐(0) 编辑
摘要: Problem A骨牌铺方格(origin:HDU 2046) 1 #include 2 int main() 3 { 4 int n,j; 5 long long a[51]; 6 while(scanf("%d",&n)!=EOF) 7 { 8 ... 阅读全文
posted @ 2015-04-01 21:13 夏弥 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1003 Hangover 1 #include 2 int main() 3 { 4 double c, cur_len; 5 scanf_s("%lf", &c); 6 while (1) 7 { 8 if (c 6 int main() 7 {... 阅读全文
posted @ 2015-04-01 11:32 夏弥 阅读(583) 评论(0) 推荐(0) 编辑
摘要: 1000 A + B Problem1 #include2 int main()3 { int a,b;4 while(~scanf("%d%d",&a,&b))5 printf("%d\n",a+b);6 return 0;7 }View Code1001 整数... 阅读全文
posted @ 2015-03-30 09:52 夏弥 阅读(509) 评论(0) 推荐(0) 编辑