标签:
// 依次将10个数输入,要求输出其中最大的数 #include <stdio.h> int main() { int a[10]; int i; int temp; printf("请输入10个数:"); for( i = 0; i < 10; i++ ) { scanf("%d",&a[i]); } for( i = 0; i < 10; i++ ) { if( a[i] > a[i+1] ) { temp = a[i]; a[i] = a[i+1]; a[i+1] = temp; } } printf("其中最大的数是:%d\n",a[9]); return 0; } <img src="http://img.blog.csdn.net/20150423114905192?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhb3lhcWlhbjU1Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
标签:
原文地址:http://blog.csdn.net/zhaoyaqian552/article/details/45219759