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

範例輸入:

8

範例輸出:

21.71
[Normal] Coding (C) - asked in 程式設計(一)AC by (17.9k points)
Available when: Unlimited - Due to: Unlimited
3 flags | 119 views
0 0
Called for Help

35 Answers

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

#include * ****** *

int main()

{


** * *** ** ***** A ,B;
** * * * * * ** *** ** ** * **
** * ** ** = sqrt(3)/4*A*A;
** * *** * * * *** * ** ***** **



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





int main (void)



{
** * ** int a,i;
** ** *

* * ***** double **
** * * * ** * *

*** * * * scanf ** ** ** * *
**** ** ** *

*** ** ** * b = ***
** ** ***

* ** ****** * c = *
***** ****

*** ** * * ** ** * ** * * *
** *** * *** *

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

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

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

#include * * ** * *

int main()

{
* **** ** *** ** * a;
*** * *** * * ** ** ** ** b;
** * * ** ** ** ** * * **** ** &a);
* * * * **** ** * *** * *** **** *
*** *** ** ** * * * * ** * *** * b);
* ***** ** ** *** * 0;

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





int ****
** ** ** *** ** * * a,ans;
*** ** ** *** *** * * ***** * * * *** ** ***
* * ***** * * = sqrt(3) * 0.25 * a * a;
*** **** * ** * * **** * * ans);


*** * * ** *** * ****** **** **

return 0;

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

#include ** * *

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

#include <math.h>





int main()
** *** ** ******* *
***** ***** * * * * * * ** *** *** a=0,c=0;
** * ** ***** ** * *** * *** ** ***** * ** * * * * * ***
* *** * * *** * *** ** * ******* *** = * ** * * * *
* ** *** * * * ***** * * **** * ** * ** *** *** * * ** *
* ***** *** * *** * * * * ****** * ** ** * 0;
** * ***** * * **** ** *
answered by (-216 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>





int main()
** ** *** * ** *
* * * * * * * * * ** *** ** **** * a=0,c=0;
** * ** * ***** ** * * **** * ** * * **** * * * ****
* **** *** * ** *** * ** * * *** * ****** ** = ((sqrt(3.0)/4.0)*(a*a));
** * **** * *** ***** ** * ** * * * ** * * * *
***** * * * * * *** * * ** ***** *** **** ** * 0;
* ***** *** * ** * **
answered by (-216 points)
0 like 0 dislike
Hidden content!
#include <stdio.h>

#include *** ** **

#include <ctype.h>





int main()
* ** **** **** **** *
***** * ** *** * * * * *** ** * * a,b,c;
******* * ** ** * *** * ** * * *** **** * **** * * *
** **** * * * ** ** * * ** **** * *** ****** * = sqrt(3.0);
**** * * * * * * * * * * **** = ((b / 4.0) * (a * a));
* * ** * ** ******* * * * * * * * ** * * ** * * * *
* * * * * * ** ** * * * ** ** * **** * 0;
*** * ******** ****** *
answered by (-216 points)
0 like 0 dislike
Hidden content!
#include ** ** ** * *

#include * **** * ***

#include **** ****

int main()

{
* * * ** * *** ***** ** * a,area;
* ** ** * ** ** * * ** * *** ** **
* ** * **** *** * * = sqrt(3) / 4 * a * a;
* * * ***** * * *** ****** * * ** * * * ** * * **


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



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

int main()

{

int a = 0;
**** * *** ***
* * ** * * *** ** ** ***


*** 0;



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



int **

{
** * **** **** ** ** n, A;


*** * * ** ** *** ********* ** , *** *
**** * * * ****** = (1.732 * n * n) / 4;
* * * ** * * *** **** * * ****** , A);



}
answered by (-90 points)
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.68.65.156
©2016-2018

Related questions

0 like 0 dislike
43 answers
[Normal] Coding (C) - asked Oct 11, 2016 in 程式設計(一)AC by Shun-Po (17.9k points)
Available when: Unlimited - Due to: Unlimited
| 106 views
0 like 0 dislike
49 answers
[Normal] Coding (C) - asked Oct 11, 2016 in 程式設計(一)AC by Shun-Po (17.9k points)
Available when: Unlimited - Due to: Unlimited
| 79 views
0 like 0 dislike
39 answers
[Normal] Coding (C) - asked Oct 11, 2016 in 程式設計(一)AC by Shun-Po (17.9k points)
Available when: Unlimited - Due to: Unlimited
| 87 views
0 like 0 dislike
7 answers
[Exercise] Coding (C) - asked Oct 27, 2016 in 程式設計(一)AC by Shun-Po (17.9k points)
Available when: 2016-10-27 18:30:00 - Due to: 2016-10-27 21:00:00
| 41 views
2,964 questions
57,158 answers
28,936 comments
938 users