?
=+


1+2+3+…+100=
11+234…,1005050
2100+1+99+2+98+…+ 49+51+50=100+49*100+50=5050
step1
step2
step3
step4
step12?x 3? y
step2x+y 2+3
step35? z
step4 z
#include <stdio.h>
void main( )
{ int x,y,z;
x=2; y=3;
z=x+y;
printf(“z=%d\n”,z);
printf(“%d+%d=%d\n”,x,y,z);
}
:
z=5
2+3=5
1.
2.
3.
4.
5.
1,
,
,
2.,
,
3,
A
B
P
A B
A
P
A
P
4,N-S
A
B
A B
P
A
P
P
A
While Until
10
#include <stdio.h>
void main( )
{ int x,max,i ;
scanf(“%d”,&max);
i=1;
do
{ scanf(“%d”,&x);
if (x>max) max=x;
i=i+1;
}
while ( i<9) ;
printf(“max=%d”,max) ;
}
5
5
t 1
i 2
i <= 5,:
t = t * i
i = i + 1
()
t
BEGIN()
1 => t
2 => i
while i <= 5
{ t * i => t
i + 1 => i
}
print t
END()
1
2
3
4
P
p1 p2 p3
p12p11 p32p31 p33