Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <math.h>
  4. #include <stdlib.h>
  5.  
  6. int main() {
  7. int ans=0,i,d,m,y,d1,m1,y1;
  8.  
  9. scanf("%d %d %d",&d,&m,&y);
  10. scanf("%d %d %d",&d1,&m1,&y1);
  11. if((y-y1)>0)
  12. {
  13. ans=10000;
  14. }
  15. else if((m-m1>0)&&(y-y1)==0)
  16. {
  17. ans=(m-m1)*500;
  18. }
  19. else if((d-d1)>0&&(m-m1)==0&&(y-y1)==0)
  20. {
  21. if(d-d1<30)
  22. {
  23. ans=(d-d1)*15;
  24. }
  25. else
  26. {
  27. ans=500;
  28. }
  29.  
  30. }
  31. else
  32. {
  33. ans=0;
  34. }
  35.  
  36. printf("%d",ans);
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement