fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <string.h>
  4. #include <errno.h>
  5.  
  6. int main(void) {
  7. float x, y, r, f ;
  8. scanf(" %f %f", &x, &y);
  9. //if (x != 0 || y != 0)
  10. {
  11. r = sqrt(x*x+y*y) ;
  12. f = atan2 (y, x);
  13. printf("z = %lg *(cos(%lg) + i*sin(%lg))\n", r, f, f);
  14. }
  15. //else printf("no answer");
  16. if (errno!=0) printf ("Error: %s!\n",strerror(errno));
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 2252KB
stdin
0 0
1 0
0 0
1,2 5,4
-1  -2
-100 356


stdout
z =  0 *(cos(0)  + i*sin(0))