roberthsu2003 / cAndC-

48 stars 18 forks source link

星期日_作業1 #12

Closed roberthsu2003 closed 9 months ago

roberthsu2003 commented 11 months ago

請計算3角型的面績

請輸入三角型的底和高(底,高):xxx,xxxx

==========================
三角型的底是:xxx
三角型的高是:xxx
三角型的面積是:xxxxxx
theS1rius commented 11 months ago
#include <stdio.h>

int main(void) {
  double bottom,height;
  printf("請輸入三角形底和高(底,高):");
  scanf("%lf,%lf", &bottom, &height);

  printf("底是%.2lf,高是%.2lf\n", bottom, height);
  printf("三角形面積是:%.2lf\n",bottom * height / 2.0 );

  return 0;
}
Agrus66666 commented 11 months ago
#include <stdio.h>

int main(void) {
//三角形面積計算

    double bottom, height;
    printf("請輸入底,高(底,高):");
    scanf("%lf, %lf", &bottom, &height);

    printf("底是%.2lf, 高是%.2lf\n", bottom, height);
    printf("三角形面積為: %.2lf\n", (bottom * height) / 2);

    return 0;
  }
lan0223333 commented 11 months ago
#include <stdio.h> //籃上淵

int main(void) {
  double bottom, height, area;
  printf("請輸入三角型的底和高(底,高):\n");
  printf("==============================\n");
  printf("輸入三角形底");
  scanf("%lf", &bottom);
  printf("輸入三角形高");
  scanf("%lf", &height);
  area = bottom * height / 2;

  printf("三角形面積%.2lf\n", area);
  return 0;
}
qwezxciop46 commented 11 months ago
#include <stdio.h>

double bottom, height;
int main(void) {
  printf("請輸入三角型的底和高(底,高):");
  scanf("%lf,%lf", &bottom, &height);
  printf("三角型的底是:%.2lf \n", bottom);
  printf("三角型的高是:%.2lf \n", height);
  printf("三角型的面積是:%.2lf \n", bottom * height / 2.0);
  return 0;
}
XOYouLinOX commented 11 months ago
#include <stdio.h>

int main(void) {
  double bottom,height,area;
  printf("輸入bottom , height: ");
  scanf("%lf ,%lf", &bottom ,&height);
  printf("bottom: %.2lf height: %.2lf\n", bottom , height );
  area=bottom * height / 2;
  printf("area:%.2lf", area);

  return 0;
}
Youcantseeme223 commented 11 months ago
#include <stdio.h>

int main(void) {
 double bottom,height;
 printf("請輸入三角型的底和高(底,高)");
 scanf("%lf,%lf",&bottom,&height);

 printf("三角形的底是:%.2lf\n",bottom);
 printf("三角形的高是:%.2lf\n",height);  
 printf("三角形的面積是:%.2lf\n",bottom*height/2);

  return 0;
}
Ray07046666 commented 11 months ago

include

int main(void) { double area,b,h; printf("請輸入三角形的底和高(底,高):"); scanf("%lf,%lf",&b,&h); printf("三角形的底是:%.2lf\n",b); printf("三角形的高是:.%.2lf\n",h); area=b*h/2; printf("三角形的面積是:%.2lf",area); return 0; }

Rickylo0918 commented 11 months ago

include

int main(void) { double bottom,height; printf("請輸入三角型的底和高(底,高)"); scanf("%lf,%lf",&bottom,&height);

printf("三角形的底是:%.2lf\n",bottom); printf("三角形的高是:%.2lf\n",height);
printf("三角形的面積是:%.2lf\n",bottom*height/2);

return 0; }

zjw0907 commented 11 months ago
#include <stdio.h>

int main(void) {
  double bottom,height;
  printf("請輸入底,高(底,高):");
  scanf("%lf,%lf",&bottom,&height);

  printf("底是%.2lf,高是%.2lf",bottom,height);
  printf("三角形面積是:%.2lf\n",bottom*height/2);

  return 0;
}
zjw0907 commented 11 months ago
#include <stdio.h>

int main(void) {

  double bottom,height,area;

  printf("請輸入三角形的底和高(底,高):");
  scanf("%lf,%lf", &bottom, &height);
area=bottom*height/2;
  printf("底是:%.2lf高是:%.2lf\n",bottom,height);
  printf("三角形面積是:%.2lf\n",area);

  return 0;
}
alvin951020 commented 11 months ago
#include <stdio.h>

int main(void) {
  double b;
  double h;
  double a;

  printf("請輸入三角型的底和高(底,高):");
  scanf("%lf,%lf",&b,&h);
  printf("三角型的底是:%.2lf",b);
  printf("三角型的高是:%.2lf",h);
  a=b*h/2;
  printf("三角型的面積是:%.2lf",a);

  return 0;
}