1. LAB 2 :
  2. Q2: Theatre Square .
  3. #include <iostream>
  4. using namespace std;
  5. int main() {
  6. long n,m,a,v,c;
  7. cin>>n>>m>>a;
  8. if (n%a ==0)
  9. v=n/a;
  10. else v=n/a +1;
  11. if (m%a==0)
  12. c=m/a;
  13. else c=m/a +1;
  14. cout << v*c;
  15. return 0;
  16. }
  17. -----------------------------------------------------------------------------------------
  18. Q3:
  19. Ciel and A-B Problem
  20. #include <iostream>
  21. using namespace std;
  22. int main() {
  23. int a,b,c;
  24. cin>>a>>b;
  25. if((a-b)%10 ==9)
  26. c=a-b-1;
  27. else if ((a-b)%10==0)
  28. c=a-b+3;
  29. else c=a-b+1;
  30. cout <<c;
  31. return 0;
  32. }
  33. -----------------------------------------------------------------------------------------
  34. JEBRIL MEJDALAWI <3 JCE
Comments powered by Disqus