…HÀM… Bài phân tích thừa số nguyên tố #include <iostream> #include <cmath> using namespace std; int main() { long long n; cin >> n; bool x = true; for (long long i = 2; i <= sqrt(n); i++) { if (n % i == 0) { int ans = 0; while (n % i == 0) { ++ans; n /= i; } if (!x) { cout << " * "; } cout << i << "^" << ans; x = false; }
} if (n > 1) { if (!x) {
#include<bits/stdc++.h> using namespace std; void pttsnt(int64_t n)