haha1235  

//九九乘法表
#include<stdio.h> int main(void) { int i,j; int a[10][10]; //定义数组
for(i=1;i<10;i++){ for(j=1;j<=i;j++){ a[i][j]=i*j; printf("%d*%d=%d\t",j,i,a[i][j]); } printf("\n");
}
return 0; }

 

 

 

 

#include <stdio.h>
#define MAX_N 100  
int main(void)                                     
{
    int n;                                      
    int i;                                        
    float Mark[MAX_N];                          
    float MaxMark,MinMark,AvgMark;                 
    float sum;  
    int Num90=0,Num80=0,Num70=0,Num60=0,Num0=0; 
    printf(" 输入成绩=");
    scanf("%d",&n);
    sum=0;
    MaxMark=0;
    MinMark=100;
    for(i = 0; i < n; i++)
    {
        printf("Mark[%d]=", i);
        scanf("%f", &Mark[i]);
    }
    
    for(i = 0; i < n; i++)
    {
        
        sum = sum + Mark[i];
        
        if(Mark[i] >MaxMark)
            MaxMark = Mark[i];
        
        if(Mark[i] < MinMark)
            MinMark = Mark[i];
        if(Mark[i] >= 90)
            Num90++;
        else if(Mark[i] >= 70)
            Num70++;
        else if(Mark[i] >= 60)
            Num60++;
        else
            Num0++;
    }
    AvgMark=0;
    AvgMark = sum / n;
    //Êä³ö
    printf("×î¸ß·ÖΪ%f\n", MaxMark);
    printf("×îµÍ·ÖΪ%f\n", MinMark);
    printf("ƽ¾ù·ÖΪ%f\n", AvgMark);
    printf("90-100µÄÈËÊýΪ%d\n", Num90);
    printf("80-89µÄÈËÊýΪ%d\n", Num80);
    printf("70-79µÄÈËÊýΪ%d\n", Num70);
    printf("60-69µÄÈËÊýΪ%d\n", Num60);
    printf("60·ÖÒÔÏÂÈËÊýΪ%d\n", Num0);

}

posted on 2013-11-10 14:18  haha1235  阅读(141)  评论(0编辑  收藏  举报