一层循环就行
#include <bits/stdc++.h>
using namespace std ;
int a[11] ;
int main ( ) {
int n ;
cin >> n ;
a[1] = 1 ;
for ( int i = 2 ; i <= n ; i ++ ) a[i] = a[i - 1] * i ;
int x = 0 , y = 0 ;
for ( int i = 1 ; i <= n ; i += 2 ) x += a[i] ;
for ( int i = 0 ; i <= n ; i += 2 ) y += a[i] ;
cout << x << ' ' << y ;
return 0 ;
}