fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n, x, y;cin >> n >> x >> y;;
  7. for (int i = 0; i < n; i++)
  8. {
  9. if (i % x != 0 && i % y != 0)
  10. {
  11. cout << i << endl;
  12. }
  13. else if (i % x == 0 || i % y == 0)
  14. {
  15. cout << "FizzBuzz" << endl;
  16. }
  17. else if (i % x == 0)
  18. {
  19. cout << "Fizz" << endl;
  20. }
  21. else if (i % y == 0)
  22. {
  23. cout << "Buzz" << endl;
  24. }
  25. }
  26.  
  27. return 0;
  28. }
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
Standard output is empty