摘要: 1 #include 2 #include 3 int main() 4 { 5 long long s2 , r2 , s3 , r3 , s4 , r4 , n ; 6 while( scanf("%lld" , &n) == 1 ) 7 { 8 s2 = n * ( n + 1 ) * ( 2 * n + 1) / 6 ; 9 s3 = n * n * ( n + 1 ) * ( n + 1 ) / 4 ;10 s4 = n * ( n + 1 ) * (2 * n + 1) * ( 3 * n * n + 3 * n -... 阅读全文
posted @ 2013-11-19 22:01 shaughn 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 int main() 4 { 5 int x , y , t; 6 scanf("%d",&t) ; 7 while(t--) 8 { 9 scanf("%d%d",&x,&y) ;10 int dis = y-x ;11 if(dis==0){printf("0\n") ; continue ;}12 int n = 1 ,k;13 while(1)14 {15 k = n*n ;16 ... 阅读全文
posted @ 2013-11-19 20:40 shaughn 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 写的很容易懂 原文:http://blog.csdn.net/qq297060023/article/details/9822805 1 #include 2 #include 3 int main() 4 { 5 int t , m , n ; 6 scanf("%d",&t) ; 7 while(t--) 8 { 9 scanf("%d%d",&m,&n) ;10 printf("%d\n",(m/3)*(n/3)) ;11 }12 return 0 ;13 } 阅读全文
posted @ 2013-11-19 16:48 shaughn 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 int main() 4 { 5 long long m , n; 6 int t = 1 ; 7 while(scanf("%lld%lld",&m,&n) && m && n) 8 { 9 printf("Case %d: %lld\n",t , m*n*(m-1)*(n-1)/4) ;10 t++;11 }12 return 0 ;13 }参考:http://cnblogs.com/xiaocai905767378/archive/2011/04/27/2030213.h 阅读全文
posted @ 2013-11-19 11:47 shaughn 阅读(112) 评论(0) 推荐(0) 编辑