mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1455.cpp
This commit is contained in:
parent
9388c50571
commit
76352e6915
24
QUSTOJ/1455.cpp
Normal file
24
QUSTOJ/1455.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include <cstdio>
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user