Thứ Sáu, 8 tháng 7, 2022

LT3 C++

#include <bits/stdc++.h>
using namespace std;
float n;
int main ()
{
    freopen("lt3.inp","r",stdin);
    freopen("lt3.out","w",stdout);
  
    cin>>n;
    while(n>1) 
        n=n/float(3);
    if(n==1)
   
        cout<<"true";
    else 
      
        cout<<"false";
}

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.