3 like 0 dislike
18k views

Write a program that reads the number of students who passed and failed in the exams and displays the percentages. For example:

輸入及格與不及格人數
輸出及格與不及格百分數

Example input:

12 8

Example output:

Success Ratio: 60%
Fail Ratio: 40%
[Exercise] Coding (C) - asked in Chapter 4: Expressions by (12.1k points)
ID: 25730 - Available when: Unlimited - Due to: Unlimited

edited by | 18k views

86 Answers

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





int main(void)



{



float ** ** ** ** * * * ***** * * *


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

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



float sum = * * * * *


* * ***** * = ***** * ** * *
**** * ** * * * **


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





return 0;

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





int main(void)



{



float **** * **** ** **** **** * *** * *


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

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



float sum = ** * ** * *** *


* ** * = * * * * * ** *
* * * * * * ** ** ** * **** *


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





return 0;

}
answered by (-107 points)
0 like 0 dislike
Hidden content!
* ** *** ****
int main()
{
******* **** a,b;
**** * * ** p,f,k;
** ***** * * ** * * * * ** * * ***** ** *
* * ** *
* *** ***** **** **
*** ** **
* ***** ***** c,d;
* * * ** ****
**** * ****
* *** * * * * ** ***** Ratio: %d%%\n",c);
*** ** *** * ** * Ratio: %d%%",d);
* * *** * 0;

}
answered by (-255 points)
0 0
-----------Re-judge-----------
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
* ***** ** * **

int main()

{
*** * * * ** a,b;
* * * * **** p,f,k;
** * ** * * ** * * * ***
** * * ** *
** * ** ** * *
** * * ** ** * * *
* * * *** * c,d;
** ** * * **
* * ** * * * ** *
* * *** * * * ** Ratio: %d%%\n",c);
* * * * * ** ** ** * * Ratio: %d%%",d);
** * * *** 0;



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

int main()

{
* **** **** a,b;
*** * *** * p,f,k;
** ***** ** * * *** *** * * * * ** *
** * *** * **
* * ** *
**** *** * **** *
* * * ** ** * c,d;
* ** * * ***
* *** *
**** * * * *** ** * Ratio: %d%%\n",c);
* * * * ** * * ** Ratio: %d%%\n",d);
* ** ** * *** 0;



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

int main()
{
** ******** ** * ** * ** a,b,c,d;
****** ******* ** * **** * ****** **** **** * ** * *
** **** * * * **** * **
** ** * ** * * ****** * ***
* ** ** ***** ** * * ** ** *** * Ratio: %d%%\n",c);
* * * * * * *** ** **** ** * * * Ratio: %d%%",d);

* *** * ** * * ** * * ** * 0;
}
answered by (-255 points)
0 0
-----------Re-judge-----------
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include * * ** * *
#include ** *** ***** *

int main()
{
** **** * * *** ** * * * * * a,b,c,d;
** ** * * *** *** ** * ** *** ***** * * *** * ** ***
* *** * ****** ****** *** * * **
** *** ** * **** * * ***** *
*** * * * ***** * * *** ** ** * Ratio: %d%%\n",c);
* **** * * ** * * ** * Ratio: %d%%",d);
*** * ** ** *** * ** **** 0;
}
answered by (-284 points)
0 0
-----------Re-judge-----------
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include * ** ** *
int main ()
{

** * ** * **** * * ** pass, fail;
** ** ** * ** * *** *********
*** ** * * *** * * * ** * * ** * * ** * &pass, *** ** *

*** * * ** * * ** * *** * ** = *** * *** * * ;
* * *** ** ** * * = *** ** * * *
** * * *** * * **** ***** *** *** Ratio: * * ** ** passratio);

** ****** * *** * * * * * * * * Ratio: * ** ** failratio);

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




}
answered by (-167 points)
0 0
-----------Re-judge-----------
Case 0: Wrong output
Case 1: Wrong output
0 like 0 dislike
Hidden content!
** ******* *** ******

int main()
{
* ** ** * ***** ** * ** a,b,c, D, E;

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

* * ** ** * * * ** ** * = a+b;
* *** * ** * ** * *** *** = (a/c)*100;
* **** ***** * **** * ** = (b/c)*100;

* * * * * * ** ** * ** * * ** Ratio: ** * * * D);
* * * ** * ** * ** * * Ratio: **** E);

}
answered by (-214 points)
0 0
-----------Re-judge-----------
Case 0: Correct output
Case 1: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>

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



int main()

{
* * * * * **** * ** a,b,c,d;
* *** * * * * * * * ** ** * * * *** ** *
**** ** *** * **** * ** * *
** ***** ****** **** ** **** *
* * ** *** * * * **** ** * * * * **** ** **
* * *** *** * ** * Ratio:%d%%",d);
* * ** * **** *** **** * * 0;

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

No related questions found

12,783 questions
183,442 answers
172,219 comments
4,824 users