During President Carter's visit here last December, the U.S. assistant secretary of state for economic affairs, Richard Cooper, took a little time off for a stroll through the Polish capital's picturesque Old Town Square.

In the course of that short stroll, as local sources tell it, Cooper was approached three times by Polish money changers offering to sell Polish zlotys for dollars at three to four times the official tourist rate of exchange.

Cooper thus inadvertently may have become the highest-ranking Western official to come face-to-face with the Polish black market in money. He is not alone.

This black market for Western money is believed to be the largest of any in Eastern Europe.

The demand for dollars especially - but also for such other strong Western currencies as the West German mark and Swiss franc - has created a second economy in Poland. The impact on Poles of having or not having such currencies is considerable.

Poles who have dollars can get a doctor to come to their apartment after hours instead of waiting in lines at clines. They can get a television set repaired fast. They have access to special government-run hard-currency Pewex stores that sell Western goods, ranging from chocolates to stereo sets that are impossible to get otherwise.

As Marian Krzak, first deputy finance minister, acknowledges. Poles can buy for $1,900 a locally built Fiat and get it fast. For Poles paying in Polish currency the same car costs 180,000 zlotys, which is equal to $5,455 at the official exchange rate of 33 zlotys to the dollar.

If they want the same car without wanting a few years, they pay 220,000 zlotys for it on a third, private market.

Krzak says the black market is a problem but places it "on the margin of Poland's economic life - a small fraction of the global economic turnover" for a country that has grown enormously in recent years through massive investments and borrowing from the West and the Soviet Union.

The more widespread view among Poles and outsiders who have lived here many years is that the existence of a "dollar economy" black market, and two and three-level pricing systems even for Polish products have created chaotic personal finances - and brought uncertainty and ill feelings to millions of people who do not have access to dollars.

Although all the Soviet-bloc socialist economies have some of these problems, they seem to swirl in the most free-wheeling fashion here.

The basic problem is that the zloty, like the Soviet ruble, East German mark or Czechoslovak koruna is not money in Western terms. Its value is not pegged to anything except perhaps the ruble, which is worthless outside the East and impossible to convert back into a Western currency.

Thus official rates of exchange are not a real measure of what zlotys or any other eastern currency are worth in terms of what they can buy.The black-market price for dollars is a much better indicator, and it is that price officials here watch.

Despite the dollar's weakness in the West, its value here has steadily increased over the years, which tells Poles that their currency is worth less and less.

Black market dealing is illegal here of course, but it seems not only to be tolerated but perhaps even encouraged.

Taxi drivers and steer sellers operate just outside major hotels, where they could be swept up if the government chose. But the street dealers are a means of getting dollars from tourists or businessmen - and are better at it than the government, which offers only the official tourist rate.

Last year, the government took an unprecedented step for Soviet-bloc countries when it allowed Poles to open dollar accounts at banks without having to explain where they got the dollars. It brought millions of dollars out from mattresses and into the banks.

Krzak says there are now some $330 million in private accounts in Polish banks, a symbol also of Polish liberalism in allowing their people to have this freedom.

Poland's huge debt to the West for its import of industry and technology is now said to be between $12 billion and $13 billion and Poland is encouraging every means to attract Western currencies to help pay it off.

Special air fares to the United States recently have been lowered to the equivalent of $100 in another move seen as encouraging Poles to travel to America, work for a while, and bring back more dollars.

Poland has far more access to Western currencies than most others in the Soviet bloc because millions of Polish-Americans send money and some 50,000 visit each year. There is also a strong tourist and business flow from neighboring West Germany. (East Germany also has millions of visits each year from West Germans.)

This has created sharp divisions between those who have dollars or West German marks and those who do not, either because they have no relatives abroad or do not work in a field where dollars are available.

The hard-currency shops established to soak up the dollars cause resentment among those who have no access.

Still, the Polish and East German governments have been unwilling to turn away the extra dollars in the name of a classless society. They have tried to solve the problem by opening specialty stores where some of the same products are sold in local currency, and at much higher prices.

Thus, while the meat lines persist at local markets here, new "commercial" markets are opening where better cuts of meat are available for double the price and with less waiting time.

For Poles who have extra zlotys, this can be unease over an increasingly complex system of prices. It has also given the government a clever way to raise meat prices for many people without provoking the riots that threatened the government of Edward Gierek here two years ago.

Aside from Poland's 33-1 tourist rate of exchange for the dollar there is a different official rate for commercial transactions, a third rate for diplomats and a fourth for retired Americans living here.

"Someday this marginal problem will be overcome" as Poland's massive investment in new factories begins to pay off at home and abroad, says Krzak, "If our citizens have freer access to cars and the ability to pay for them in Zlotys, then I'm certain that the black market, which flourishes now, won't be as profitbale.