fork download
  1. /*======================================================
  2. //函數名:c_comp_product
  3. //功能描述:求複數的乘法
  4. //輸入參數:a1(第一個乘數a的結構體)
  5. //     a2(第二個乘數b的結構體)
  6. //     c(計算結果的結構體)
  7. //返回值:0(失敗),1(成功)
  8. =========================================================*/
  9. #include "stdio.h"
  10. #include "stdlib.h"
  11. #include "math.h"
  12. struct c_comp{
  13. double rmz;
  14. double imz;
  15. }c_comp;
  16. int c_comp_product(a1,a2,c)
  17. struct c_comp *a1,*a2,*c;
  18. {
  19. double p,q,s;
  20. if(a1 == NULL || a2 == NULL || c == NULL)
  21. {
  22. printf("(c_comp_product)The c_comp pointer is NULL!\n");
  23. return(0);
  24. }
  25. p = a1->rmz*a2->rmz;
  26. q = a1->imz*a2->imz;
  27. s = (a1->rmz + a1->imz)*(a2->rmz + a2->imz);
  28. c->rmz = p - q;
  29. c->imz = s - p - q;
  30. return(1);
  31. }
  32.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i486-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty