public long sum(int num){long sum = 0;for (int i = 1; i <= num; i++){long f = 1;//求i的i次方for (int j = 1; j <= i; j++){f *= i;}sum += f;}return sum;}