From ea5d4b120ddb754089ee6001230c2d1ad9c7ec65 Mon Sep 17 00:00:00 2001 From: Udhay Date: Tue, 20 Oct 2020 16:04:36 +0530 Subject: [PATCH] Power_of_78.cpp added --- C++/Misc/Power_of_78.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 C++/Misc/Power_of_78.cpp diff --git a/C++/Misc/Power_of_78.cpp b/C++/Misc/Power_of_78.cpp new file mode 100644 index 0000000..30528b3 --- /dev/null +++ b/C++/Misc/Power_of_78.cpp @@ -0,0 +1,17 @@ +/* Check whether a number is power of 78 or not. */ +#include +using namespace std; +int main() { + int n,a; + cin>>n; + while(n--){ + cin>>a; + if(ceil(log(a)/log(78)) == floor(log(a)/log(78))){ + cout<<1<