qfedu-basic-level/day6/homework/h1.cpp

27 lines
401 B
C++

#include <iostream>
using namespace std;
int main()
{
int n;
cout << "请输入一个整数: ";
cin >> n;
if (n % 3 == 0)
{
if (n % 5 == 0)
{
cout << "FizzBuzz" << endl;
}
else
{
cout << "Fizz" << endl;
}
}
else if (n % 5 == 0)
cout << "Buzz" << endl;
else
cout << n << endl;
}