: 姓名: 学号:Р∶∶∶∶∶∶∶∶装∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶订∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶∶线∶∶∶∶∶∶∶∶Р开始Рs=0Рi=1Рs=s+iРi=i+1РYРi<=100РNР输出sР结束Р#include<stdio.h>Рmain()Р{int s,i;Рs=0;Рi=1;РdoР{Р s=s+i;Р i++;Р }Рwhile(i<=100);Рprintf(“s=%d\n”,s);Р}Р得分Р评卷人Р五.编程题(每题12分,共36分)Р1.编写程序按公式c=2(a+b)求平行四边形周长.Р#include<stdio.h>Рmain()Р{float a,b,c;Рprintf(“a,b=”);Рscanf(“%f%f”,&a,&b);Рc=2*(a+b);Рprintf(“c=%f\n”,c);Р}Р2.编写程序输入一个分数x(0--100)按下列情况输出其属于那个级别.Р x≥80 优秀Р 60≤x<80 中等Р x<60 不及格Р#include<stdio.h>Рmain()Р{float x;Рprintf(“x=”);Рscanf(“%f”,&x);Рif(x>=80)Р printf(“优秀”);Рelse if(x>=60)Р printf(“中等”);Р else printf(“不及格”);Р}Р3.某班50人,编写程序输入该班级某门课程的成绩存入数组a,求该班级课程平均分.Р#include<stdio.h>Рmain()Р{float a[50],sum,aver;Рint i;Рfor(i=0;i<50;i++)Р scanf(“%f”,&a[i]);Рsum=0;Рfor(i=0;i<50;i++)Р sum=sum+a[i];Рaver=sum/50;Рprintf(“平均=%5.2f\n”,aver);Р}