微生物增值
include
using namespace std;
int main(void)
{
double x=10.0,y=89.0; for(int i=1;i<=120;i++) { if(i%2==0) { y-=x; if(y<0) y=0; } if(i%4==0) y=y*2; if(i%6==0) x=x*2; } cout<<x<<" "<<y<<endl; return 0;
}
2012.2
古堡算式
include
include
using namespace std;
int main(void)
{
int nums[10]={0,1,2,3,4,5,6,7,8,9}; do{ if(nums[0]==0) continue; int a=nums[0]*10000+nums[1]*1000+nums[2]*100+nums[3]*10+nums[4]; int b=nums[0]+nums[1]*10+nums[2]*100+nums[3]*1000+nums[4]*10000; if((a%b==0)||(b%a==0)) { cout<<a<<endl; } }while(next_permutation(nums,nums+10)); return 0;
}
2012.3
海盗比酒量
include
using namespace std;
int main(void)
{
for(int i=20;i>=1;i--) { for(int j=1;j<i;j++) { for(int k=1;k<j;k++) { for(int m=1;m<k;m++) { if(m*(i+j)*k+i*j*k+m*i*j==i*j*k*m) { cout<<i<<" "<<j<<" "<<k<<" "<<m<<endl; } } } } } return 0;
}