标签:style blog http color io os for 数据 div
在清澄上面看到这么可爱的一道题,这么早的提高组,还想试试多简单……真是很简单……
#include<iostream> #include<cstdlib> #include<cstdio> using namespace std; int main() { bool s[20000]={0}; int a1,a2,a3,a4,a5,a6,sum,total; cin>>a1>>a2>>a3>>a4>>a5>>a6; total=0; for (int a=0;a<=a1;a++) for (int b=0;b<=a2;b++) for (int c=0;c<=a3;c++) for (int d=0;d<=a4;d++) for (int e=0;e<=a5;e++) for (int f=0;f<=a6;f++) { sum=a*1+b*2+c*3+d*5+e*10+f*20; if (s[sum]==false) {total++; s[sum]=true; } } cout<<"Total="<<total<<endl; return 0; }
标签:style blog http color io os for 数据 div
原文地址:http://www.cnblogs.com/seekdreamer/p/3988821.html