用C++编写程序完成:输入10个整数,求出最大值和最小值之和。要求使用数组存储10个整数。

日期:2014-06-10 20:02:36 人气:1

用C++编写程序完成:输入10个整数,求出最大值和最小值之和。要求使用数组存储10个整数。

#include #include using namespace std; int cmp ( const void *a , const void *b ) { return *(int *)a - *(int *)b; } int main() { int a[10]; for(int i=0;i<10;i++){ cin>>a[i]; } qsort(a,10,sizeof(a[0]),cmp);
    A+
热门评论