题目连接
£:若n<4,NO;
£:若n==4,特判,n==5,特判。
£:若n>=6,用2-4组成24,1和5和6组成零,即可。
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int n;
int main ()
{
while(scanf("%d",&n)!=EOF)
{
if(n<4)
{
printf("NO\n");
}
else
{
printf("YES\n");
if(n==4)
{
cout<<"2 * 4 = 8"<<endl;
cout<<"3 * 8 = 24"<<endl;
cout<<"1 * 24 = 24"<<endl;
}
else if(n==5)
{
cout<<"3 - 1 = 2"<<endl;
cout<<"2 + 2 = 4"<<endl;
cout<<"4 * 5 = 20"<<endl;
cout<<"20 + 4 = 24"<<endl;
}
else
{
cout<<"1 + 5 = 6"<<endl;
cout<<"6 - 6 = 0"<<endl;
for(int i=7;i<=n;i++)
cout<<"0 * "<<i<<" = 0"<<endl;
cout<<"2 * 3 = 6"<<endl;
cout<<"4 * 6 = 24"<<endl;
cout<<"24 + 0 = 24"<<endl;
}
}
}
return 0;
}