Tuesday, January 21, 2020

Codeforces 50A Domino piling Solution in C



  1. #include<stdio.h>
  2. int main()
  3. {
  4. int x,y,p,s,a=0,b=0;
  5. scanf("%d%d",&x,&y);
  6. if (x>=1 && x<=y && y<=16)
  7. {
  8. p=x*y;
  9. while (p>a)
  10. {
  11. a=a+2;
  12. if (a<=p) b++;
  13. }
  14. printf("%d\n",b);
  15. }
  16. return 0;
  17. }

No comments:

Post a Comment

Codeforces 131A cAPS lOCK Solution in C

#include <stdio.h> int main () { char ch [ 106 ]; int i , j , ck = 1 ; scanf ( "%s" , ch ); ...