Be VERY CAREFUL using credit cards in Brazil. If you are not careful you can pay up to a 50 percent increase in price. Practically all restaurants near copacabana will try it if you don't pay attention.
If you have a US credit card the machines will have the option to pay in US dollars and do the conversion, like a lot of other countries. But the rate is murder, literally 50 percent more. I always pay in local currency with credit cards but I always notice the attempted exchange. For instance, I had to option to pay 200 real (less than 40usd) or 60 usd.
Always use contact less payments with your card because it doesn't give them the option to choose that way. Some machines will refuse the contact less payments and it's certain those machine will ask a choice of conversion. I usually take the machine myself so the server can't choose quickly.
But I actually prefer to go to the atm and get cash. This is what I do in most countries as most have fee free atms and if you're not dumb enough to accept the atms conversion, you will get the real conversion from your bank.