Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. cout << "Enter multiple for Fire: ";
  8. int fire;
  9. cin >> fire;
  10. cout << endl;
  11. cout << "Enter multiple for Ice: ";
  12. int ice;
  13. cin >> ice;
  14. cout << endl;
  15.  
  16. for (int i = 1; i < 101; i++)
  17. {
  18. if (i % fire == 0)
  19. {
  20. if (i % ice == 0)
  21. {
  22. cout << "Fire and Ice" << endl;
  23. }
  24. else
  25. {
  26. cout << "Fire" << endl;
  27. }
  28. }
  29. else if (i % ice == 0)
  30. {
  31. if (i % fire == 0)
  32. {
  33. cout << "Fire and Ice" << endl;
  34. }
  35. else
  36. {
  37. cout << "Ice" << endl;
  38. }
  39. }
  40. else
  41. {
  42. cout << i << endl;
  43. }
  44. }
  45. cout << endl;
  46.  
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement