Advertisement
lily09290110

a830超級細菌

Feb 5th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4. int main(i)
  5. {
  6.     int mt[100];
  7.     int ne[100];
  8.     int x,y,z,w,j,temp=0;
  9.     memset(mt,0,sizeof(mt));
  10.     memset(ne,0,sizeof(ne));
  11.     scanf("%d%d%d%d%d%d",&mt[0],&ne[0],&w,&x,&y,&z);
  12.     for(i=1;i<=w;i++)
  13.     {
  14.         for(j=y;j>0;j--) mt[j]=mt[j-1];
  15.         for(j=x;j>0;j--) ne[j]=ne[j-1];
  16.         mt[0]=mt[y]+ne[x];
  17.         ne[0]=mt[y]*z;
  18.         mt[y]=0;ne[x]=0;
  19.     }
  20.     for(j=y;j>=0;j--) temp+=mt[j];
  21.     for(j=x;j>=0;j--) temp+=ne[j];
  22.     printf("%d\n",temp);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement