fix buzz number

This commit is contained in:
Krishna Vedala
2020-05-27 18:00:02 -04:00
parent 3b07bc120a
commit e963ba4c5b

View File

@@ -1,17 +1,20 @@
//A buzz number is a number that is either divisble by 7 or has last digit as 7.
/**
* @file
* @brief A buzz number is a number that is either divisible by 7 or has last
* digit as 7.
*/
#include <iostream>
using namespace std;
int main()
{
int n, t;
cin >> t;
while (t--)
{
cin >> n;
if ((n % 7 == 0) || (n % 10 == 7))
cout << n << " is a buzz number" << endl;
else
cout << n << " is not a buzz number" << endl;
}
return 0;
/** main function */
int main() {
int n, t;
std::cin >> t;
while (t--) {
std::cin >> n;
if ((n % 7 == 0) || (n % 10 == 7))
std::cout << n << " is a buzz number" << std::endl;
else
std::cout << n << " is not a buzz number" << std::endl;
}
return 0;
}