3 喜歡 0 不喜歡
18.1k 瀏覽

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%
[練習] Coding (C) - 最新提問 分類:Chapter 4: Expressions | 用戶: (12.1k 分)
ID: 25730 - 從幾時開始: 無限制 - 到幾時結束: 無限制

修改於 用戶: | 18.1k 瀏覽

86 個回答

0 喜歡 0 不喜歡
內容已隱藏
#include * ** ***** *
int main ()
{

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

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

*** ** * *** ** * * * *** * Ratio: * * * failratio);
return 0;
}
最新回答 用戶: (-167 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include * * * ***
int main ()
{

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

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

** * ** * *** * ** ** Ratio: * **** failratio);
return 0;
}
最新回答 用戶: (-167 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include * ** ***** *
int main ()
{

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

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

* ** * * * * ** ** * *** *** Ratio: ** * * * * failratio);
*** * * ** 0;
}
最新回答 用戶: (-167 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include * **** * * *
int main ()
{

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

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

*** * * * * *** * * *** * * ** **** Ratio: *** * * * ** failratio);
return 0;
}
最新回答 用戶: (-167 分)
0 0
prog.c: In function 'main':
prog.c:11:32: warning: unknown conversion type character 0xa in format [-Wformat=]
     printf("Success Ratio:  %d%\n", passratio);
                                ^
prog.c:13:28: warning: spurious trailing '%' in format [-Wformat=]
     printf("Fail Ratio:  %d%", failratio);
                            ^
0 喜歡 0 不喜歡
內容已隱藏
**** ********* ** **
int main(void)
{
** * **** *** ** * a, a1,b,b1;
**** ** * *** * * * * *** ** * *** * ** ***
* * * * * * ***** **
* * * **** ** *
* * * ** * * *** *** *** * Ratio: *** *******
* * **** *** **** * * ** ** Ratio: %g%%",b1);
* ********** * *** 0;
}
最新回答 用戶: (-254 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* * ** ** *** * * **
int **
int * * * p1,p2;
* ** * * * * * *** *** **** * *
**** ****
**** * *
* * *** * Ratio: **** Ratio: ****** * **
* ** 0;}
最新回答 用戶: (-32 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
* ***** * ** * *
int main()
{
float a,b,c;
* * * * **** *** ** ** * * ** * * * * * ***
** *** * * * * * *****
*** ** **** ***** * ** ** * * Ratio: ** * ** * *
*** * * * * *** * ***** **** Ratio: %.0f%%",b/c*100);
* *** **** *** * *** ** 0;
}
最新回答 用戶: (64 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
int main ()
{
** * * * ** ** ** **** a,b,c;
* ** *** ** * * *** * * * **** * ***** * *
*** *** **** * * ** ** * ***
* * *** * * ******* * ** ** ** * * * * * Ratio: ** *
******* ** ** *** ** **** * ** * Ratio: *** ***** * *
* **** * ** * ** * * * * 0;
}
最新回答 用戶: (54 分)
0 0
Case 0: Correct output
Case 1: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
int main ()
{
** *** ** ** ** * * a,b,c;
** * *** * * **** ***** * * ***** **** **
**** * * * * **
***** ** *** * *** ** *** ** * *** ** * * Ratio: ****** ** * **
*** * ** *** * * *** ** ** ** Ratio: * *** * * ***
* ** * ** * * * *** ** 0;
}
最新回答 用戶: (54 分)
0 0
prog.c: In function 'main':
prog.c:5:13: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'float *' [-Wformat=]
     scanf("%d %d",&a,&b);
             ^
prog.c:5:16: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'float *' [-Wformat=]
     scanf("%d %d",&a,&b);
                ^
0 喜歡 0 不喜歡
內容已隱藏
*** * * ***

int main()

{
* ******* * ** * *** ** a,b,c,d;
* * * ** * * * *** *** ** ** * ***
* * * ** * **** * *** ** * **** * * * * * * *

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

*** ** * * * * * * * *** *** * *** Ratio: %.f%%\n",c);
********* * * * * * * ** * * Ratio: %.f%%",d);
* ** ****** ** *** * *

* * * *** ** **** * 0;
}
最新回答 用戶: (-32 分)
修改於 用戶:
0 0
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main(void)
 ^~~~
0 0
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^~~~
0 0
Case 0: Correct output
Case 1: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:162.159.115.10
©2016-2026

沒有找到相關問題

12,783 問題
183,442 回答
172,219 留言
4,824 用戶