연습 볼거 없음

아군사랑 작성일 13.09.11 05:06:06
댓글 1조회 1,435추천 0

#include<iostream>

using std::cout;
using std::cin;
using std::endl;


int main()
{
 int sum,max,min;
 int num[8];
 int count=0;
 
 sum=max=0;
 min=1000000;

 while(count<8){
                cout<<count+1<<"번째 숫자 입력: ";
                cin>>num[count];
             
                sum+=num[count];
                if(max<num[count])
                                  max=num[count];
                if(min>num[count])
                                  min=num[count];
                cout<<endl;                  
                count++;
 }
 
 count=0;
 cout<<"입력 받은 수 : ";
 while(count<8){
                cout<<num[count]<<"   ";
                count++;
 }
 
 cout<<endl<<endl<<"sum : "<<sum<<" , average : "<<sum/8<<" , max : "<<max<<" , min : "<<min;
 
 getchar();
 getchar();
 return 0;
}

자유·수다 인기 게시글