有关C的
程序代码:
#include < stdio.h > #include < stdlib.h > #include < math.h > void main ( ) { double n1, n2, k1, k2, t, j, i, m = 1, sum, sum1 = 0,sum2 = 0; printf ( "输入4个数,第二个比第一个大,第四个比第三个大\n" ); scanf ( "%f%f%f%f", &n1, &n2, &k1, &k2 ); for ( i = n1; i <= n2; i++ ) sum1 = sum1 + 2*i*i; printf ( "%f\n", sum1 ); for ( j = k1; j <= k2; j++ ) { for ( t = 1; t <= k1; t++ ) m = m * t; sum2 = sum2 + m * pow ( -1, i ); printf ( "%f\n", sum2 ); } sum = sum1 + sum2; printf ( "%f", sum ); system ( "pause" ); }运行不了