The multi-unmanned aerial vehicle (UAV) must autonomously perform reconnaissance-attack-evaluation tasks under multiple constraints in the battlefield environment. This paper proposes a nearest neighbor method designed with the shortest neighboring distance as an indicator which quickly solves the optimal sequence of multiple tasks for cooperative execution. Each target to be destroyed requires a different quantity of ammunition; a cooperative task assignment model for heterogeneous UAVs is established accordingly. Based on the nearest neighbor method, and with reference to fruit-picking techniques currently in use, a novel "orchard picking algorithm (OPA)" is investigated as well. This algorithm proposed in this paper is a heuristic algorithm, which has a broad application prospect in complex task assignment. A cooperative attack task assignment is simulated to test the performance of the algorithm. In essence, it balances the assignment of tasks, works within a brief execution time, and exhibits high flexibility, strong robustness, and scalability.