0 like 0 dislike
3.1k views
正三角形的面積公式是[4分之根號3乘a平方],請設計一個程式,讓使用者輸入正三角形的邊長,然後輸出正三角形的面積,輸出時請輸出並四捨五入到小數點後兩位。

範例輸入:

8

範例輸出:

21.71
[Normal] Coding (C) - asked in 2016-1 程式設計(一)AD by (18k points)
ID: 13421 - Available when: Unlimited - Due to: Unlimited
| 3.1k views

21 Answers

0 like 0 dislike
Hidden content!
* ** * *** **



int ** * {

float A,B;
* * ** *** * ** ** ** **
* ** * *
**** ** ** * ** ***
** ** 0;

}
answered by (-102 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include * * * ** *



int main()

{
* *** * *** * ***** * length = 0 ;
** ** * * * ** * * **** * *** ****** * ** * *** *

* * ** * * * *** * **** * **** * ** * ** ** ** *
* * ** ** **** * ** * *
** ** * ** ** ** ** * * ** ** ** *
******* ** * *** ** * 0;

}
answered by (-162 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>



int main()

{
* * * ** * * *** * i = 0;
* * * * ** **** **** * k;
****** * * ** * *
* * * * * * * * * ** **** * * ** *
** * *** *** * *
*** *** * *** **** * * * / 4 * (i * i);
* **** * ****** * ***
* ** ** * * * ** ***** * ** ** ** **
*** * * ** ** ***** *
** *** ** *** ** *
* * ****** * * ** * ***
*** * ***** * * *** ** * ** ****** **
*** **** *** * *** ** ***** 0;

}
answered by (-264 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>
** * *** * * ** *

#include<math.h>

int main()

{
* * * * ****** ** * ** a;
**** * * ** * * * * * * s=0;
** * **** * * * * * *
*** * ***** *** * ** * ***** ** ** * ****
*** ** ****** * * ****** = (sqrt(3)/4)*(a*a);
*** *** * * *** ** ***** * ** ** ** **
*** * ** ** * * ** * ** *** * * * * **
* * * ** ** **** 0;

}
answered by (156 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>

#include<stdlib.h>

#include<math.h>



int main()



{   
***** * * ** ** ** *
** ***** * * ** ** ** x;
* **** ****** *** ****** *
* * ** * ** *** ***** y;
******* * ** ** *** *** ****
* * **** **** **** * ** * *** ** * ** ** *
*** * * ** ** * ******
********** * * * * ** *
* * ** * * * **** ** * **
* * * * ** ** ** *** * * * * * * * ***


** *** *** *** *** ****** ** ***
* ***** * ** * *
** ** * * * ** 0;
* *** * *** * ******* **

}
answered by (122 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include *** * **



int main(int argc, char *argv[])

{
* *** **** * ** * * * * l,t;
* * * **** ** * * * * ** * * **** * **
* * * ** * * ** *
* ***** * *** ** * * *** ** * * ** * * * *** * *** * *
****** *** * *** ***
* ** **** ** * * * ** **** ** * ** *
*** ******* * * *
* * * * ****** * ** **** * 0;

}
answered by (-216 points)
0 like 0 dislike
Hidden content!
#include ** ** * *

#include ** ****** **

#include <math.h>

int main()

{
* ** * ** * * * ****** * a, s;
*** * * * ** **** **** * ****
** ** ** *** * * * * ** * * *
* * * * * ** ** *** ***** * * *


*** * ***** * * * ** * * * 0;

}
answered by (-146 points)
0 like 0 dislike
Hidden content!
#include *** *** *
* * ***** *** *

int main()

{
** ***** ***** ********* * * length;
* * **** * * * *** * * ** * **** ** * * * *
* ** ** * ** **** area=0;
* * * ** = (1/4) * sqrt(3) * length * length;
* * * * * * * ** *** * * * ** * ** * * * area);
* ** **** **** * * * 0;

}
answered by (-202 points)
0 like 0 dislike
Hidden content!
#include<stdio.h>
*** ** ** *

#include<math.h>



int main()



{
* * * * ** *** * * * ** **** * a = 0 , b = 0  ;
* **** *** ** ****
* * ** **** ** * *** * * ** * ** * ** ** , &a);
* * ** * ***** ** * **
**** * ******* ** * * = (sqrt(3)*a*a)/4;
* * ** * *
* ** * * ** ** * *******
**** * * ** *** * * * * * ***
***** *** * * ** ** ****** * *** * * * *** , b );
** * * * * **** * **** ** **
** **** ** * **** * * * ** ** * * *
* * *** * * ** * **** **** ***** 0 ;
* * ** ** * * * *** * *

}
answered by (-186 points)
0 like 0 dislike
Hidden content!
* * * * * * ** *
* ** ** * *
** ** * *** *






* *** *
*
*** * a , **


** * * * *** * *** , *


*** = * ** **


*** *** ** * * **** ** * , **





** ** ** * * ** *


**** 0;












answered by (-194 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.130.93
©2016-2025

Related questions

0 like 0 dislike
23 answers
[Normal] Coding (C) - asked Oct 11, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 13024 - Available when: Unlimited - Due to: Unlimited
| 4k views
0 like 0 dislike
21 answers
[Normal] Coding (C) - asked Oct 11, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 13022 - Available when: Unlimited - Due to: Unlimited
| 3.7k views
0 like 0 dislike
54 answers
[Normal] Coding (C) - asked Oct 11, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 13021 - Available when: Unlimited - Due to: Unlimited
| 7.1k views
0 like 0 dislike
3 answers
[Exercise] Coding (C) - asked Oct 27, 2016 in 2016-1 程式設計(一)AD by Shun-Po (18k points)
ID: 15398 - Available when: 2016-10-27 18:30:00 - Due to: 2016-10-27 21:00:00
| 1.2k views
0 like 0 dislike
0 answers
[Resource] asked Dec 31, 2016 in 2016-1 程式設計(一)AD by laich (937 points)
ID: 20301 - Available when: Unlimited - Due to: Unlimited
| 16 views
12,783 questions
183,442 answers
172,219 comments
4,824 users