2019-07-28 19:36:07
#include <stdio.h>int main(){ int index; int iArray[]={14,25,45,85,15,65,4,5,53,12,1,8,7,9,0,2,8,4,5,6,0}; for(index=0;index<21;index++){ printf("Spare seat number:%d\n",iArray[index]); } return 0;}
2019-07-14 14:38:21
#include <stdio.h>void main(){ int grade[10]={95,85,45,78,68,91,90,55,48,80}; int total=0; int i; float avg; for(i=0;i<10;i++){ total+=grade[i]; } avg=((float)total/10); printf("the student's average score is %f\n",avg);}
2019-07-14 10:55:40
#include <stdio.h>int main(){ int iArray[3],index; printf("请输入语文,数学和英语的成绩:\n"); for(index=0;index<3;index++){ scanf("%d",&iArray[index]); } printf("语文,数学和英语的成绩分别是:\n"); for(index=0;index<3;index++){ pri
2019-07-07 23:33:11
#include <stdio.h>int main(){ int iStep; int iSelect; for(iStep=1;iStep<10;iStep++){ printf("第%d步\n",iStep); do{ printf("请输入一个步数:\n"); printf("(0 表示退出,99 表示下一步)\n"); scanf("%d",&iSelect);
2019-07-07 21:53:24
#include <stdio.h>int main(){ int iCount; for(iCount=0;iCount<10;iCount++){ if(iCount==5){ printf("find a true friend\n"); break; } printf("Friend %d\n",iCount); } return 0;}
2019-07-07 21:23:05
#include <stdio.h>int main(){ int iRow,iColumn; for(iRow=1;iRow<=9;iRow++){ for(iColumn=1;iColumn<=iRow;iColumn++){ printf("%d*%d=%d ",iRow,iColumn,iRow*iColumn); } printf("\n"); } return 0;}
2019-07-07 21:13:46
#include <stdio.h>int main(){ int i,j,k; for(i=1;i<=5;i++){ for(j=1;j<=5-i;j++) printf(" "); for(k=1;k<=2*i-1;k++) printf("*"); printf("\n"); } return 0; }
2019-07-07 17:33:07
#include <stdio.h>int main(){ int iNumber; int iSum=0; for(iNumber=1;iNumber<=100;iNumber++){ iSum=iNumber+iSum; } printf("the result is %d\n",iSum); iSum=0; iNumber=1; while(iNumber<=100){ iSum=iSum+iNumber; iNumber++; } pri
2019-07-07 17:26:02
#include <stdio.h>int main(){ int high=80; int i; for(i=0;i<6;i++){ high/=2; printf("the height of the current is %d\n",high); } printf("the height of the sixth is %d\n",high); return 0;}
2019-07-07 16:37:30
#include <stdio.h>int main(){ int num=0; scanf("%d",&num); do{ num++; printf("还能承载%d人,\n",26-num); }while(num<=25); printf("座位已满,不能再承载了.\n"); return 0;}