コマンドプロンプトで無事コンパイルは出来たみたいなのですが、実行しようとすると途中でexeファイルが停止してしまいます。
毎回x= を入力した後に停止しましたと出てきます。
パソコン本体を再起動してもだめでした。
解決策があれば教えて頂きたいです。
#include<stdio.h>
#include<math.h>
struct Point3D{
float x;
float y;
float z;
};
struct kyokuzahyou{
float a;
float b;
float c;
};
void main()
{
Point3D i ;
kyokuzahyou t ;
printf("点の座標(x,y,z)を入力\n");
printf(" x = ");scanf("%lf",i.x);
printf(" y = ");scanf("%lf",i.y);
printf(" z = ");scanf("%lf",i.z);
t.a = sqrt( pow( i.x , 2 ) + pow( i.y , 2 ) + pow( i.z , 2 ));
t.b = atan( sqrt( pow ( i.x , 2 ) + pow ( i.y , 2 ) ) / i.z );
t.c = atan2(i.y,i.x);
printf("(x,y,z)=(%f,%f,%f)", i.x, i.y, i.z);
printf(" => ");
printf("(r,θ,φ)=(%f,%f,%f)", t.a , t.b , t.c);
printf("\n");
}