Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Please type your username.

Please type your E-Mail.

Please choose an appropriate title for the question so it can be answered easily.

Please choose the appropriate section so the question can be searched easily.

Please choose suitable Keywords Ex: question, poll.

Browse
Type the description thoroughly and in details.

Choose from here the video type.

Put Video ID here: https://www.youtube.com/watch?v=sdUUx5FdySs Ex: "sdUUx5FdySs".

You must login to add post.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Hỏi Đáp 123

Hỏi Đáp 123 Logo Hỏi Đáp 123 Logo

Hỏi Đáp 123 Navigation

  • Home
  • Blog
  • Communities
  • Ask Question
  • Tags
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Q&A mới nhất
  • Blog
  • Liên hệ
  • Groups
  • Privacy Policy
  • Terms and Conditions
  • FAQs
Home/ Questions/Q 58629
In Process
Hạ Ly
  • 0
Hạ Ly
Asked: Tháng Mười Một 4, 20232023-11-04T16:57:02+00:00 2023-11-04T16:57:02+00:00

Câu 04: Số có nhiều ước nguyên tố nhất Cho trước hai số nguyên dương , . Trong các số nguyên dương

  • 0

Câu 04: Số có nhiều ước nguyên tố nhất
Cho trước hai số nguyên dương , . Trong các số nguyên dương mà , tìm
số có nhiều ước nguyên tố nhất. Nếu có nhiều số có cùng số lượng ước nguyên
tố, in ra số lớn nhất.
Dữ liệu vào:
– Gồm duy nhất 1 dòng là 2 số nguyên dương .
Kết quả:
– Gồm duy nhất 1 dòng là 2 số nguyên lần lượt là số tìm được và số lượng
ước nguyên tố của nó.
VD: inp out
2 13 12 2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
    • Report
  • Share
    Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp
Leave an answer

Leave an answer
Hủy

Browse

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Thùy Linh
    Thùy Linh
    2023-11-04T16:57:02+00:00Added an answer on Tháng Mười Một 4, 2023 at 4:57 pm

    `Code` `C`++:

    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    ll prime(ll k){
    if (k<2) return 0;
    for (ll i=2; i<=sqrt(k); i++)
        if (k%i==0)
            return 0;
        return 1;
    }
    ll divprime (ll k){
    ll dem=0,i;
    for (i=1; i<=sqrt(k); i++)
        if (k%i==0 && prime(i)==1)
            dem++;
        return dem;
    }
    int main(){
    ll a,b,n,i,x,d=-1,res;
    cin>>a>>b;
    for (i=a; i<=b; i++)
        if (d<divprime(i)){
            d=divprime(i);
            res=i;
        }
        cout<<res<<” “<<d;
    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions : 54k
  • Answers : 48k
  • Posts : 17
  • Best Answers : 568
  • Users : 94

Câu trả lời mới nhất!

Login

Forgot Password?

Explore

  • New Questions
  • Most Answered
  • Answers
  • Most Visited
  • Most Voted
  • No Answers

© 2023 hoidap123.com. All Rights Reserved

Thêm/Sửa đường dẫn

Nhập địa chỉ đích

Hoặc liên kết đến nội dung đã tồn tại

    Thiếu từ khóa tìm kiếm. Hiển thị các bài viết mới nhất. Tìm hoặc sử dụng phím mũi tên lên và xuống để chọn một mục.