We assume high-energy electrons with flux and spectrum varying in step are injected from the top of the flare loop and calculated the time evolution of the spectral index as a function of the target matter density and the duration of the injection. It is found that the hard X-rays coming from the top of the loop have a soft-hard-hard time profile, and those from the footpoints of the loof have a soft-hard-soft variation. The duration of injection affects the height at which the soft-hard-hard profile changes to the soft-hard-soft profile.