C/C++の宿題を片付け ..
[2ch|▼Menu]
855:デフォルトの名無しさん
08/11/15 19:29:32
}
struct mycomplex cinput(void) {
struct mycomplex z;
scanf("%f %f",&z.re,&z.im);
return z; }
void cprint(struct mycomplex z) {
printf("複素数 = %f + i*%f\n",z.re,z.im); }
struct mycomplex wa(struct mycomplex a, struct mycomplex b) {
struct mycomplex z = { a.re+b.re, a.im+b.im };
return z; }
struct mycomplex sa(struct mycomplex a, struct mycomplex b) {
struct mycomplex z = { a.re-b.re, a.im-b.im };
return z; }
struct mycomplex seki(struct mycomplex a, struct mycomplex b) {
struct mycomplex z = { a.re*b.re - a.im*b.im, a.re*b.im + a.im*b.re };
return z; }
struct mycomplex shou(struct mycomplex a, struct mycomplex b) {
struct mycomplex z = {
(a.re*b.re + a.im*b.im) / (b.re*b.re + b.im*b.im),
(a.im*b.re - a.re*b.im) / (b.re*b.re + b.im*b.im)
};
return z; }
double cabs(struct mycomplex a) {
return hypot(a.re, a.im); }
すいません、動かないんで何処が違うか教えてください
854の続きです




次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

4994日前に更新/337 KB
担当:undef