#include <stdio.h>
#include <math.h>
int main()
{
int n, _sum = 0;
scanf("%i", &n);
for (int i = 1; i <= n; i++){
_sum += pow(i, 3);
}
printf("%i", _sum);
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <stdio.h>
#include <math.h>
int main()
{
int n, _sum = 0;
scanf("%i", &n);
for (int i = 1; i <= n; i++){
_sum += pow(i, 3);
}
printf("%i", _sum);
return 0;
}