#include <iostream>
#include <vector>
using namespace std;
void output(const int& M, const int& N, const int& count)
{
cout<<"Case #"<<count+1<<":"<<endl;
cout<<M*N<<" = "<<N;
for(int i=1;i<M;i++)
cout<<" + "<<N;
cout<<endl;
}
int main()
{
int M,N;
vector<int> ivec;
int count = 0;
while(cin>>M>>N)
{
if(M==0&&N==0)
break;
count++;
ivec.push_back(M);
ivec.push_back(N);
}
vector<int>::const_iterator iter = ivec.begin();
int i = 0;
if(count>0)
{
M = *iter++;
N = *iter++;
output(M, N, i);
i++;
}
for(;i<count; i++)
{
cout<<endl;
M = *iter++;
N = *iter++;
output(M, N, i);
}
return 0;
}
------------------
不用考虑负数的形式。。。