- 854 名前:デフォルトの名無しさん [2008/11/15(土) 19:24:18 ]
- #include<stdio.h>
#include<math.h> struct mycomplex { double re; double im; }; int main() { struct mycomplex a,b; struct mycomplex wa(struct mycomplex,struct mycomplex); struct mycomplex sa(struct mycomplex,struct mycomplex); struct mycomplex seki(struct mycomplex,struct mycomplex); struct mycomplex shou(struct mycomplex,struct mycomplex); double cabs(struct mycomplex); struct mycomplex cinput(void); void cprint(struct mycomplex); a=cinput(); b=cinput(); cprint(wa(a,b)); cprint(sa(a,b)); cprint(seki(a,b)); cprint(shou(a,b)); printf("絶対値 cabs(a)=%f\n",carbs(a)); printf("絶対値 cabs(b)=%f\n",cabs(b)); } struct mycomplex cinput(void) { struct mycomplex z; scanf("%f %f",&z.re,&z.im); return z;
|

|