fork download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. float otvet(int h, int m)
  6. {
  7. float x = (m / 60.0f) * 360.0f;
  8. float hh = (h / 12.0f) * 360.0f;
  9. float add = (m/60.0f)*1/12.0f*360.0f;
  10.  
  11. return fabs(hh + add - x);
  12. }
  13.  
  14. int main() {
  15. cout << otvet(3, 15) << endl;
  16. return 0;
  17. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
7.5