fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. for (int i = 10; i >= 1; i--) {
  6. cout << i;
  7.  
  8. if (i > 8) {
  9. cout << ".";
  10. } else if (i == 8) {
  11. cout << ". ";
  12. } else if (i > 1) {
  13. cout << ", ";
  14. }
  15. }
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
10.9.8. 7, 6, 5, 4, 3, 2, 1