一、题目;

二、N-S流程图;

三、运行结果;

四、源代码;
cs
# define _CRT_SECURE_NO_WARNINGS
# include <stdio.h>
int main()
{
//初始化变量值;
int i = 0;
int j = 0;
int n = 5;
int result = 0;
int sum = 0;
//运算;
for (i = 1; i <= n; i++)
{
//内层;
for (j = 1; j <= i; j++)
{
//运算;
result = result + j;
}
//运算;
sum = sum + result;
//初始化;
result = 0;
}
//输出结果;
printf("结果为:%d", sum);
return 0;
}