fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5. double a, y;
  6. scanf("%lf", &a);
  7. if (a > 0) y = -a * a;
  8. else y = -a;
  9. printf("%lg",y);
  10. return 0;
  11. }
Success #stdin #stdout 0s 3300KB
stdin
7
stdout
-49