#include <stdio.h>
#include <math.h>
int main()
{數組
double x1,x2,y1,y2,ret; while(scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2)!=EOF) //注意輸入的順序 { getchar(); ret = sqrt(pow(x2-x1,2) + pow(y2-y1,2)); //調用求平方根庫函數 printf("%.2lf\n",ret); } return 0;
}ide
#define PI 3.1415927
#include <stdio.h>
#include <math.h>
int main()
{函數
double r,ret; while(scanf("%lf",&r)!=EOF) { getchar(); ret = (4 * PI * r * r * r)/3; printf("%.3lf\n",ret); } return 0;
}code
#define _CRT_SECURE_NO_WARNINGS 1get
#include <stdio.h>
int main()
{it
double num,ret; while(scanf("%lf",&num)!=EOF) { getchar(); if(num<0) { printf("%.2lf\n",-num); } else printf("%.2lf\n",num); } return 0;
}io