摘要:
代码用了2次的if判断,第一次先求出最大的数。第二次则利用if语句剔除第一个最大的数,把剩余的数再次排序,于是最大的2个数就出来了。不过C++或者C#中有sort和arrays函数。也可以排序,而且代码也简介... 不过这样就失去了思考的意义了....#include <iostream>using namespace std;int main(){ int counter=0,number[10],larges=0,larges1=0; while(counter<=9) { cin>>number[counter]; if(number[counter]> 阅读全文
posted @ 2011-04-26 20:30
逝去的小丑
阅读(1119)
评论(0)
推荐(0)

浙公网安备 33010602011771号