//Uva725
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
using namespace std; void evalu(int n)
{
const int maxn = + ;
char num[]; //将数字用字符保存
int flag[]; //判断每个数,是否重复
char buf[maxn]; //将出现的字符全部存到里面
for (int i = ; i <= ; i++)
{
memset(flag, , sizeof(flag));
memset(num, , sizeof(num));
sprintf(num, "%05d", i);
// cout << "Debug: " << num << endl;
// system("pause");
int digit = , rest = ;
digit = (num[]-'')* + (num[]-'')* + (num[]-'')* + (num[]-'')* + (num[]-'');
// cout << "Debug:digit: " << digit << endl;
// system("pause");
rest = digit * n;
sprintf(buf, "%05d%05d", rest, digit);
int len = strlen(buf), j = ;
for (j = ; j < len; j++) {
if (flag[buf[j] - '']) {
break;
}
else {
flag[buf[j] - ''] = ;
}
}
if (j == len) {
cout << rest << " / " << num << " = " << n << endl;
}
}
} int main()
{
int num;
while (cin >> num) {
evalu(num);
}
return ;
}
//Uva11059
#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <fstream>
using namespace std; //ifstream in("in.txt");
//ofstream out("out.txt"); int main()
{
long long pro = , max_pro = ;
vector<long long> num;
long long data;
int T, kase = ;
while (cin >> T)
{
num.clear();
pro = max_pro = ;
while (T--) {
cin >> data; num.push_back(data);
}
for (unsigned i = ; i < num.size(); i++) {
pro = num[i];
for (unsigned j = i; j < num.size(); j++) {
if (i != j) {
pro *= num[j]; //pro尽管乘
if (pro > num[i]) //pro > num[i]
num[i] = pro; //num[i] = pro, 将最大的乘积放到该位置
}
}
}
for (unsigned i = ; i < num.size(); i++) {
if (num[i] > max_pro) {
max_pro = num[i];
}
}
cout << "Case #" << ++kase << ": The maximum product is " << max_pro << "." << "\n\n";
}
return ;
}