易语言程序 求圆的面积.周长
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/10 20:21:50
#include#definePI3.1415926doublearea(doubler){returnPI*r*r;}doubleperimeter(doubler){return2*PI*r;}i
在输入半径的时候,语句改成scanf("%d",&r);不过你最好将半径定义成float型变量,格式的问题
scanf("%d",&r);
voidmain(){floatr,s,l;floatpi=3.1415;printf("输入一个圆的半径:\n");scanf("%f",&r);if(
intarea(intx,inty){returnx*y;}intgri(intx,inty){return2*(x+y);}
#include<stdio.h>double zc(double x, double y){ ret
在vc++编译的.#includevoidmain(){floatl;printf("enterperimeter:");scanf("%f",&l);printf("square=%.2f\n",l
楼上的方法应该没错,可感觉对于表现java面向对象的特性没有表现出来,下面是我写的,应该非常清楚明了了importjava.io.BufferedReader;importjava.io.InputS
#include <stdio.h>int main(){ float c = 6, PI =&
#include"stdio.h"#definePI3.14159intmain(){floatnR;floatnArea;printf("请输入圆的半径:");scanf("%f",&nR);nAr
#include#definePI3.1415926intmain(){floatL;floatS=0;printf("Pleaseinputcircum:");scanf("%f",&L);S=L*
#include#includepublicvoidmain(){doublea,b,c;scanf("%lf%lf%lf",&a,&b,&c);doublearea,preimeter;preime
#includeintmain(){intr=0;floata=0,l=0;scanf("%d",&r);a=r*r*3.14;l=r*2*3.14;printf("面积:%f,周长:%f",a,l)
tyoe8strdyt9e
C#程序:using System;class Program{ static void Main()
#include//doubleellipse_area(doublea,doubleb);intmain(void){doublea,b;doubles;printf("请输入椭圆的半长轴a,半短轴
假设知道三角形的三边长为a,b,c.程序如下:#include#includedoublearea(doublea,doubleb,doublec){doublearea=0,s=0;s=(a+b+c
#include#includeintmain(){doublea,b,c,s,area,perimeter;printf("Enter3sidesofthetriangle:");scanf("%l
#...intr,b,dsin
m=2a+2b;应该改成m=2*a+2*b;程序中2a,2b是不允许的,没有意义的.