mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Added buzz number program.
This commit is contained in:
parent
d4d004fe83
commit
2618482840
17
Buzz_number.cpp
Normal file
17
Buzz_number.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
//A buzz number is a number that is either divisble 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user