发布网友 发布时间:2024-10-01 11:09
共2个回答
热心网友 时间:2024-10-02 11:23
流程图
程序
#include <stdio.h>
void main(void)
{
int i, S=0;
for(i=1; i<=99; i+=2)
{
S+=i*i;
}
printf("%d\n", S);
}
热心网友 时间:2024-10-02 11:31
Rem 语言:Visual Basic 6.0
Sub Main() '开始
S = 0 : i = 1
Do
S = S + i ^ 2
If Not (i < 99) Then Exit Do
i = i + 2
Loop
MsgBox S, vbInformation, "输出"
End Sub '结束
Rem Language:QuickBASIC Extended 7.1
S = 0 : i = 1
Do
S = S + i ^ 2
If Not (i < 99) Then Exit Do
i = i + 2
Loop
PRINT S