fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4.  
  5. void display(const std::string &pair, const std::string &exch, double bid, double ask) {
  6. std::cout << std::setfill(' ')
  7. << std::setw(9) << std::left << pair
  8. << " [" << std::setw(10) << std::right << exch << "] "
  9. << std::fixed << std::setprecision(2) << bid << ' ' << ask
  10. << std::endl;
  11. }
  12.  
  13. int main() {
  14. display("BTC-USDT", "FTX", 20460.91, 20470.09);
  15. display("BTC-USDT", "BINANCE_US", 20457.34, 20467.28);
  16. display("BTC-USDT", "BINANCE_US", 20457.50, 20467.28);
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5544KB
stdin
Standard input is empty
stdout
BTC-USDT  [       FTX] 20460.91 20470.09
BTC-USDT  [BINANCE_US] 20457.34 20467.28
BTC-USDT  [BINANCE_US] 20457.50 20467.28