This paper investigates the fixed/predefined-time optimization problems of multi-agent systems under switching topology. Two-stage exponential-function-based algorithms are proposed for these problems. The first stage ensures agent states converge to their local optimums within fixed/predefined time, which eliminates the requirement that the initial state must be at its local optimum in the zero-gradient-sum algorithm; The second stage guarantees all agents achieve the global optimum of the optimization problem within fixed/predefined time. Based on the convex optimization theory and the Lyapunov stability theorems, the fixed/predefined-time convergence of the developed algorithms is analyzed. Note that the proposed algorithms do not need to exchange the gradient and Hessian matrix information. Additionally, their designs eliminate the dependence on signum function, contain fewer parameters and offer a simplified design. Finally, the obtained results are verified by a numerical simulation.