Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这是我的核心部分,大家帮忙看看啊In Reply To:为什么老RE啊 Posted by:tibelf at 2007-12-30 21:56:39 bignum a[10010] ; int main(){ int n , m ; bignum sum ; int b[4000]; while( cin >> n ) { sum = 0 ; n += 2 ; a[0] = 1 , a[1] = 1 ; for( int i = 2 ; i < n ; i ++ ) a[i] = a[i-1] + a[i-2] ; sum += ( a[n-2] * a[n-4] + a[n-3]*a[n-3] ) * ( a[n-2] * a[n-4] + a[n-3]*a[n-3] ) ; sum += a[n-2] * a[n-3] * a[n-3] * a[n-4] * 4 ; sum = sum * 2 + 2 ; m = 0 ; while( sum > 0 ) { b[m++] = sum %1000 ; sum = sum / 1000 ; } cout << b[m-1] ; for( int i = m - 2 ; i >= 0 ; i -- ) { if( b[i] > 100 ) cout << "," << b[i] ; else if( b[i] > 10 ) cout << ",0" << b[i] ; else cout << ",00"<< b[i] ; } cout << endl ; } return 0 ; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator