Due to the limited computing capacity of mobile device and high network-accessing delay, user in the area where mobile terminals are densely distributed (e.g., schools, malls, and hospitals) will experience high latency when processing multiple computation-intensive tasks. In this paper, a computation offloading scheme based on Device-to-Device (D2D) communication is proposed to deal with the problem that users have multiple tasks to process. Exploiting nonorthogonal multiple access (NOMA), user can offload tasks to multiple nearby devices that have available idle computing resource. We aim to minimize the user’s total cost including time latency, energy consumption, and offloading charge, which is formulated as a mixed integer nonlinear programming (MINLP) problem. We use decomposition approach to solve our problem and propose a two-layer optimization scheme named Multitask Joint Computation Offloading and Resource Allocation (MT-JCORA). In the inner layer, the NOMA-transmission time optimization problem in given task offloading decision is proved as a strictly convex problem. In the outer layer, we design a heuristic algorithm based on GA algorithm to obtain the optimal task offloading decision. Simulation results demonstrate that MT-JCORA can effectively reduce the total cost of user compared with related schemes.