Although the Chinese government has condemned last week's U.S. attack on Libya, some residents of Peking have quietly applauded the action because they see in Libyan leader Muammar Qaddafi the same kind of personality cult that surrounded the late chairman Mao Tse-tung.

In informal conversations, workers and students in the Chinese capital said they felt President Reagan was justified in taking action against Libya.

"They [the ordinary Chinese] think Qaddafi is Libya's Chairman Mao," said one English-speaking Chinese university student who asked not to be identified by name.

Two of them said, however, that while they felt Qaddafi deserved to be punished, the bombing raid ordered by Reagan was an excessive action that might not resolve the situation.

All of the Chinese who responded briefly to questions criticized Qaddafi as irresponsible and dangerous.

"Some Chinese think that Qaddafi has a nervous disorder," said the university student. "Some think he's crazy."

The student said the Chinese see in Qaddafi the same kind of "megalomania" and personality cult that prevailed in China under the one-man rule of Mao.

He said some Chinese see similarities between the Libyan Green Books containing Qaddafi's thoughts and the Little Red Books of Mao's thoughts that radical Red Guards once brandished to show their devotion to Mao. The student's comments appeared to be another indicator of how far Mao has fallen in the eyes of some Chinese.

"People really don't like Qaddafi," said a Chinese intellectual who follows world affairs. "First of all, they think Qaddafi is rather arrogant and doesn't act like a statesman. Second, the Chinese really hate people who engage in terrorism."

At the same time, this Chinese said, "I don't think people like the idea that civilians got killed in the bombing."

A few Chinese, including workers, said Qaddafi got what he deserved.

Anti-Qaddafi sentiments here seemed to be based to a great extent on government-controlled Chinese television coverage of the U.S.-Libya crisis. Chinese newspapers and televison have presented both sides of the story, carrying statements from Washington and Tripoli.

Some footage from Libya provided by American television networks has included pictures of civilians killed and wounded in the bombing.

An April 15 Chinese government statement condemned the U.S. bombing of Tripoli and Benghazi as an encroachment on Libyan territory and sovereignty that violated international norms and "drastically worsened" the situation in the Mediterranean and the Middle East. But the statement also said the Chinese government "has always opposed and condemned all forms of terrorism."

A foreign resident of Peking who speaks Chinese and watches Chinese television regularly said the Chinese press coverage of the conflict has been "ambivalent."

"If they really were in solidarity with Libya, they could easily cover only the Libyan side of the story," he said. "They're stuck with Libya because it falls into that category of nonaligned Third World countries that they've got to support . . . . But I doubt that they have much sympathy for Qaddafi."