herrDeng網內搜尋

自訂搜尋

Ads

2009年9月10日 星期四

C程式練習

int a[]={21, 23, 57, 13 ,17, 6};
float average;

average=?

74 則留言:

B9733141 提到...

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
  float  x=0;
  int a[6]={21,23,57,13,17,6};
  x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
  printf("%f平均數:",x/6);
  system("PAUSE"); 
  return 0;
}

B9733145 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

B9733181 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

B9733184 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

b9733144 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[]={21, 23, 57, 13 ,17, 6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f平均數",x/6);
    system("pause");
    return 0;
}

b9733166 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);   
    system("pause");
    return 0;
}

B9733144 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[]={21, 23, 57, 13 ,17, 6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f平均數",x/6);
    system("pause");
    return 0;
}



答案:22.833333

B9733141 提到...

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
  float  x=0;
  int a[6]={21,23,57,13,17,6};
  x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
  printf("%f平均數:",x/6);
  system("PAUSE"); 
  return 0;
}

ANS:22.833333

b9733184 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[]={21, 23, 57, 13 ,17, 6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f平均數",x/6);
    system("pause");
    return 0;
}



答案:22.833333

b9733166 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);   
    system("pause");
    return 0;
}

A:22.833333

B9733188 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

B9733188 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

ANS:22.833

b9733168 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
 int a[]={21,23,57,13,17,6};
 int sum=0 ,i;
 float average;
       for(i=0;i<6;i++)
       sum+=a[i];
average=(float)sum / 6;
printf("average=%f",average);
system("pause");
return 0;
}

average=22.833334

B9733136 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

B9733139 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

b9733173 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
 int a[]={21,23,57,13,17,6};
 int sum=0;
 float average=0;
 {
     for(int i=0;i<6;i++)
                     sum=sum+a[i];
 }
 average=sum/6.0;
 printf("%f",average);
 system("pause");
 return 0;
       
}



average=22.83334

B9733174 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

B9733123 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

b9733127 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

答案:22.833333

B9733170 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
int t[6]={21,23,57,13,17,6};
int c[1]={5};
int i,sum=0;
float average;
for (i=0;i<6;i++)
sum=sum+t[i]*c[1];
int x=0;
for (i=0;i<6;i++)
x=x+c[1] ;
average=(float)sum/x;
printf("average=%f\n",average);

system("Pause");
return 0;
}

B9733161 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}


答:22.833333

B9733163 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}


答:22.833333

B9733130 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int sum = 0;
    float average;
    int i;
    for (i=0; i<6; i++)
       sum += a[i];
    average= (float)sum /6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

B9733129 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int sum = 0;
    float average;
    int i;
    for (i=0; i<6; i++)
       sum += a[i];
    average= (float)sum /6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

B9733165 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21,23,57,13,17,6};
    int sum=0;
    float average;
    int i;
    for(i=0;i<6;i++)
        sum+=a[i];
    average=(float)sum/6;
    cout<<"平均:"<<average<<endl;
    system("Pause");
    return 0;
}

B9733145 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int sum = 0;
    float average;
    int i;
    for (i=0; i<6; i++)
       sum += a[i];
    average= (float)sum /6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

B9733170 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
int t[6]={21,23,57,13,17,6};
int c[1]={5};
int i,sum=0;
float average;
for (i=0;i<6;i++)
sum=sum+t[i]*c[1];
int x=0;
for (i=0;i<6;i++)
x=x+c[1] ;
average=(float)sum/x;
printf("average=%f\n",average);

system("Pause");
return 0;
}
ans:22.833333

B973151 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

B9733137 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

B9733134 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    int a[]={21 , 23 , 57 , 13 , 17 , 6};
    int i,sum=0;
    float y;
    for(i=0;i<=5;i++)
    {
        sum=sum+a[i];
    }
    y=(float)sum/6;
    printf("average=%f\n",y);
    system("pause");
    return 0;
}

B9733133 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

B9733171 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

B9733143 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733126 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum=0;
    float average;
    for (i=0;i<6;i++)
     sum=sum+a[i];
    average=(float)sum/6;
    printf("平均:%f\n",average);
    system("pause");
    return 0;
}




答案:22.833334

B9733159 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

B9733135 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    int a[]={21,23,57,13,17,6};
    int i,sum=0;
    float y;
    for(i=0;i<=5;i++)
    {
        sum=sum+a[i];
    }
    y=(float)sum/6;
    printf("average=%f",y);
    system("pause");
    return 0;
}

B9733176 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int sum = 0;
    float average;
    int i;
    for (i=0; i<6; i++)
       sum += a[i];
    average= (float)sum /6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

b9733152 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733183 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733162 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733124 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733128 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733149 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

B933175 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733140 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
   int a[6]={21,23,57,13,17,6};
   int sum=0;
   float average;
   int i;
   for(i=0;i<6;i++)
        sum+=a[i];
   average=(float)sum/6;
   cout<<"平均:"<<average<<endl;
   system("pause");
   return 0;
}

b973132 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733138 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21,23,57,13,17,6};
    int i,sum = 0;
    float average;
     for (i=0; i<6; i++)
     {
       sum= sum+a[i];
     }
       average=(float)sum/6;
    printf("ave=%5.2f\n",average);
    system("pause");
    return 0;
}
 

b9733131 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int i,sum=0;
    float average;
    for (i=0; i<6; i++)
    {
       sum=sum+a[i];
       }
       average=(float)sum/6;
    printf("average:%5.2f\n",average);
    system("pause");
    return 0;
    }

B9733193 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("平均數%f",x/6);
    system("pause");
    return 0;

B9733194 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

b9733125 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
int a[6]={21,23,57,13,17,6};
int i,sum = 0;
float average;
for (i=0; i<6; i++)
{
sum= sum+a[i];
}
average=(float)sum/6;
printf("ave=%5.2f\n",average);
system("pause");
return 0;
}

B9533067 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
   float x=0;
   int a[6]={21,23,57,13,17,6};
   x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
   printf("%f平均數:",x/6);
   system("pause");
   return 0;
}

b9533031 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
int a[6]={21,23,57,13,17,6};
int i,sum = 0;
float average;
for (i=0; i<6; i++)
{
sum= sum+a[i];
}
average=(float)sum/6;
printf("ave=%5.2f\n",average);
system("pause");
return 0;
}

b9533041 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
int a[6]={21,23,57,13,17,6};
int i,sum = 0;
float average;
for (i=0; i<6; i++)
{
sum= sum+a[i];
}
average=(float)sum/6;
printf("ave=%5.2f\n",average);
system("pause");
return 0;
}

b9733150 提到...

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int a[6]={21,23,57,13,17,6};
int sum=0;
float average;
int i;
for(i=0;i<6;i++)
sum+=a[i];
average = sum / 6.;
printf("平均:%f\n",average);
system("PAUSE");
return 0;
}

b9533053 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
int a[6]={21,23,57,13,17,6};
int i,sum = 0;
float average;
for (i=0; i<6; i++)
{
sum= sum+a[i];
}
average=(float)sum/6;
printf("ave=%5.2f\n",average);
system("pause");
return 0;
}

B9733192 提到...

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
float average ;
int a[]={21, 23, 57, 13 ,17, 6};


int i = 0 ;
int sum = 0 ;

while ( i < 6 ) {
sum = sum + a[i] ;
i++ ;
}

average = sum / 6. ;

printf ( "%f\n", average ) ;
system("PAUSE");
return 0;
}

B9733156 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
int a[]={21, 23, 57, 13 ,17, 6};
int i,sum=0;
float average;
for(i=0; i<6; i++)
{
sum=sum+a[i];
}
average=(float)sum/6;
printf("average:%5.2f\n",average);
system("pause");
return 0;
}

b9733179 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21,23,57,13,17,6};
    int sum=0;
    float average;
    int i;
    for(i=0;i<6;i++)
    sum+=a[i];
    average=(float)sum/6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

b9533009 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21, 23, 57, 13 ,17, 6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f平均數:",x/6);
    system("pause");
     return 0;
}

b9533055 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21, 23, 57, 13 ,17, 6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f平均數:",x/6);
    system("pause");
     return 0;
}

B9733141 提到...

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
  int a[]={21,23,57,13,17,6};
  int i;
  float sum=0;
  for(i=0;i<=5;i++)
  {
   sum+=a[i];
  }
  printf("%f\n",sum/6);
  system("PAUSE"); 
  return 0;
}

ans:22.833333

B9533145 提到...

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
int a[]={21, 23, 57, 13 ,17, 6};
float sum=0;
float average;
for(int i=0;i<6;i++)
{
sum=sum+a[i];
};
average=sum/6;
cout<<average;
system("PAUSE");
return EXIT_SUCCESS;
}

B9733182 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int sum = 0;
    float average;
    int i;
    for (i=0; i<6; i++)
       sum += a[i];
    average= (float)sum /6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

B9733128 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int sum = 0;
    float average;
    int i;
    for (i=0; i<6; i++)
       sum += a[i];
    average= (float)sum /6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

B9733178 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int sum = 0;
    float average;
    int i;
    for (i=0; i<6; i++)
       sum += a[i];
    average= (float)sum /6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

B9733142 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
    int a[6]={21, 23, 57, 13 ,17, 6};
    int sum = 0;
    float average;
    int i;
    for (i=0; i<6; i++)
       sum += a[i];
    average= (float)sum /6;
    cout<<"平均:"<<average<<endl;
    system("pause");
    return 0;
}

b9733183 提到...

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
  float  x=0;
  int a[6]={21,23,57,13,17,6};
  x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
  printf("%f平均數:",x/6);
  system("PAUSE"); 
  return 0;
}

d9711066 提到...

#include
#include
int main(int argc, char *argv[])
{
float x=0;
int a[6]={21,23,57,13,17,6};
x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
printf("%f平均數:",x/6);
system("PAUSE");
return 0;
}

b9633029 提到...

#include<stdio.h>
#include<stdlib.h>
int main()
{
    float x=0;
    int a[6]={21,23,57,13 ,17,6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f",x/6);
    system("pause");
    return 0;
}

b9633029 提到...

#include <stdio.h>
#include <stdlib.h>
int main()
{
    float x=0;
    int a[]={21, 23, 57, 13 ,17, 6};
    x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
    printf("%f平均數",x/6);
    system("pause");
    return 0;
}

b9633006 提到...

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
  float  x=0;
  int a[6]={21,23,57,13,17,6};
  x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
  printf("%f平均數:",x/6);
  system("PAUSE"); 
  return 0;
}

b9633024 提到...

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
  float  x=0;
  int a[6]={21,23,57,13,17,6};
  x=a[0]+a[1]+a[2]+a[3]+a[4]+a[5];
  printf("%f平均數:",x/6);
  system("PAUSE"); 
  return 0;
}

b9733147 提到...

#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int a[6]={21, 23, 57, 13 ,17, 6};
int sum = 0;
float average;
int i;
for (i=0; i<6; i++)
sum += a[i];
average= (float)sum /6;
cout<<"平均:"<<average<<endl;
system("pause");
return 0;
}

Related Posts Plugin for WordPress, Blogger...

熱門文章