本文共 418 字,大约阅读时间需要 1 分钟。
题意很简单呐,给出一串数字,算出其中互为2倍的数字有多少对。
利用选择排序的那种思想就能搞定这个
还有关于那个输出的那种结构需要自己动动脑子想一下#includeusing namespace std;int num[20];void func(int count){ //判断为2倍的数有多少对,输出对数 int total=0; for(int i=0;i >temp){ if(temp==0){ func(count); count=0; } if(temp==-1) break; num[count] = temp; count++; } return 0; }
happy coding
欢迎一起来讨论~~~
转载地址:http://qtujn.baihongyu.com/