s=1+1+2+....+1+2+3+...+10

来源:百度知道 编辑:UC知道 时间:2024/05/19 04:01:27
程序编辑

#include <stdio.h>
#include <conio.h>

main()
{
int n,p;
int s=0;
for (n=1;n<=10;n++)
for (p=1;p<=n;p++)
s+=p;

printf ("%d\n",s);
getch();
}

省略部分没有规律嗄是不是打错了,

看不懂哦,省略得太多,分析不出规律