(3rd question = =)
Original question:
The prime factors of 13195 is 5, 7, and 29.
What is the largest prime factor of the number 600851475143?
Effect:
Ask you 600851475143 the maximum factor is how much.
(Fourth question = =)
Original question:
A palindromic number reads the same both ways. The largest palindrome made from the product of both 2-digit numbers is 9009 = 91x99.
Find the largest palindrome made from the product of the 3-digit numbers.
Effect:
Let you find two 3-digit multiply results maximum palindrome number.
Calculation code:
#include <bits/stdc++.h>//3 using namespace std;
int main () {Ios::sync_with_stdio (false);
Long Long n,ans=2;
cin>>n;
Long Long fac= (long Long) sqrt (n*1.0+0.5) +1;
Long Long i=2;
while (i<=fac&&n>1) {while (n%i==0) {n/=i;
Ans=max (Ans,i);
} i++;
} cout<<ans<<endl;
return 0;
} #include <bits/stdc++.h>//4 using namespace std;
BOOL Ispal (string s) {string Rev;
Rev.assign (S.rbegin (), S.rend ());
if (S==rev) return true;
return false;
} int main () {Ios::sync_with_stdio (false);
StringStream SS;
string S;
int ans=0;
for (int i=999;i>=100;i--) {for (int j=999;j>=100;j--) {ss.clear ();
ss<< (I*J);
ss>>s;
if (Ispal (s)) {Ans=max (I*j,ans);
}}} cout<<ans<<endl; RetUrn 0;
}
Answer:
This is the first time the topic of Web-based project EULA, look at math problems, exercise brain-This problem is very simple, violence to find out. = =