C/C++の宿題を片付けます 116代目at TECH
C/C++の宿題を片付けます 116代目 - 暇つぶし2ch879:デフォルトの名無しさん
08/10/28 11:04:05
>>857
課題1
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/* (x,y)-平面の点を座標で表す構造体 */
struct Point{
double x, y;
};

/* 原点からの長さを求める関数 */
double length_vector(struct Point *p){
return sqrt(pow(p->x, 2) + pow(p->y, 2));
}

/* 平面の点を表示する関数 */
void print_v(struct Point *p){
printf("(%f, %f)\n", p->x, p->y);
}


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