From 76352e69153a5eddd2e78d9803a5965ac4670b57 Mon Sep 17 00:00:00 2001 From: KiritoTRw <3021577574@qq.com> Date: Thu, 26 May 2016 07:52:33 +0800 Subject: [PATCH] Create 1455.cpp --- QUSTOJ/1455.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 QUSTOJ/1455.cpp diff --git a/QUSTOJ/1455.cpp b/QUSTOJ/1455.cpp new file mode 100644 index 0000000..a709862 --- /dev/null +++ b/QUSTOJ/1455.cpp @@ -0,0 +1,24 @@ +#include +using namespace std; + +int main() +{ + long n; + while(scanf("%ld",&n)==1&&n!=0) + { + if(n==1) + { + printf("0\n"); + continue; + } + int t=1; + --n; + while(n>=3) + { + n=n/3; + t++; + } + printf("%d\n",t); + } + return 0; +}