0 like 0 dislike
8.2k views

Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case 大寫小寫), n is the length of the array

寫compute_GPA函數。函數會return成績平均(A = 4, B = 3, C = 2, D = 1, F = 0)

#include <stdio.h>
float compute_GPA(char grades[],int n)
{
   /*INSERT YOUR CODE HERE*/


   /*END OF YOUR CODE*/
   //The function should return the average of the grades(assume that A=4,B=3,C=2,D=1, and F=0).
}

int main(void)
{
   char G[100];
   int n;

   /*INSERT YOUR CODE HERE*/


   /*END OF YOUR CODE*/

   printf("%g",compute_GPA(G,n));

   return 0;
}

Example input: 

The first input is the number of elements need to compute GPA (4); The array values follow; 

第一行是成績數目,第二行是成績(A/B/C/D/F)

4
A B C D

Example output

2.5

Remember: You may correct the cases, but your code always be revised!

[Exercise] Coding (C) - asked in Chapter 9: Functions by (5.2k points)
ID: 37278 - Available when: 2017-12-14 18:00 - Due to: Unlimited

edited by | 8.2k views

50 Answers

0 like 0 dislike
Hidden content!
#include <stdio.h>
float compute_GPA(char grades[],int n)
{
* ** *** *** ****** * * i;
**** * ** *** * ** avg,sum=0;
** * * ** ** * * ****** ** ** ******* **
* * ***** ** * ** *****
** * * * **** ** * * * * ** * ** * * ** ** * *
***** ***** * ** * * * * ** * * ** ** ** ***** * * ** * * ***** * *
* ** ** **** ** ** * **** * * * ** ** ** ** * * if(grades[i]=='B'||grades[i]=='b')
** ** ** ** * * * * *** ** * * * ** ** ** * * **** * *** * *
*** ** ** ** * * * * * * * * * *** **** **** * if(grades[i]=='C'||grades[i]=='c')
* * * * ** ** *** * ***** * ** **** ******** * * **** ****** * *
* **** * ** *** * ** **** * * * *** ** * * if(grades[i]=='D'||grades[i]=='d')
* * ** **** ** **** ***** ** * * * * * *** *** * * * ** *** *
* ** * * * ***** **** * * ******* * * if(grades[i]=='F'||grades[i]=='f')
* *** ** * * * * * * * * * ********* * * ** ** ** * * ** ***** ** * ** ***
* * * * * * * *
* *** ** * ***** **** *** *
return avg;
}
int main(void)
{
*** **** * * ** *** G[100];
   int n,i;
******** * ** ** *** ** * * ** * * *

** ** * ** ** ** * ** **
   {
* ** ** ***** * * ** *** * * ** ** **** * * *** * ** * ***** * *
   }
*** * * *** *** ***** *** *** * ***** * *

* **** * * **** *** 0;
}
answered by (-258 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include *** *** * * * *
float **** * grades[],int n)
{
** * ** *** * YOUR CODE HERE*/
int i;
double p=0;


for * * * *
{
switch (grades[i])
{
* **** * ******* 'A':
* *** ** 'a': {
* * ** * * * *** ** * * * *** **
** ***** *** *** ** * **** * * * ***
**** * * ** * 'B':
* ** * ** * ** 'b':{
** * ** * ***** * ** * * **
******* * * ** * * ** * **** *** * *
* * * *** * 'C':
*** * * * 'c':{
* ** * **** * * ** * * ** ** *
* ***** *** ** * * * * **** * ****
**** ** *** *** 'D':
*** ***** * **** 'd':{
* *** * * * * * *** * ** ** *
* ** ** *** ***** * **** *** * **
** ** ** * * 'F':
** * ** *** ** 'f':{
* * * * ** * ** ** ** *** * ** **
}

}
return p/n;
* * **** ** *** * * OF YOUR CODE*/
** ** **** ** ** function should return the average of the *** * that *** ** and F=0).
}

int main(void)
{
* * * * ** **** G[100];
*** * *** * ** n;

** ** * **** * * * YOUR CODE HERE*/
* * * * * * * * * * * * * * ****
int i;
** *** * ( i = 0 ; i < n ; i++ ) * * * *** * *** * **** ** array A
* * ** * *** ** * * *** * ** ****
* * ** ** * *** * ** * ** * * * * ** * *** ** ** *** ** ** * *** *
** ****** *** * ** ** *** ** **
* ** * ** * * OF YOUR CODE*/

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

* * * * ** * * * 0;
}
answered by (-336 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
float compute_GPA(char grades[],double n)
{
* * **** ** *** * * YOUR CODE HERE*/
** ***** ** * * ** c;
** * * * *** * * ** * * sum,avg;
*** * ** * *** ** ** * ** (c=0;c<n;c++)
***** *** ** ** * ***
*** ** *** * ** ** ** ** ** * ** ** * (grades[c]=='A'||grades[c]=='a')
*** *** * ** ** ** ***** ** * ** ** * * * * * * ** ** * * *** * * ****
* *** * * ** * * *** * **** * *** * * * ** if * ** ** * * *
*** * *** * * * ** ** * *** ****** * *** * * ***** * ** * ** * *
** ** * * ***** *** * * * ** **** ** **** ** ***** if (grades[c]=='C'||grades[c]=='c')
* ** * * * * ** ** ** *** ** * *** * ** * * * * ** * * ** ** ** * **
** ***** * ** * * * ** ** *** * * ** * if ** * * ** * *
** * ****** ** *** *** * * * * *** ** * ** *** * * * **** *
** **** *** * ** * *
**** * ******* * * * * * *
* ** ***** * * * * * avg;
** ** ** * * * * OF YOUR CODE*/
* *** * * * * * function should return the average of the grades(assume that A=4,B=3,C=2,D=1, and F=0).
}

int main(void)
{
* * * * * * * G[100]={};
* * * *** *** * n,c;

* * * ** * * * * YOUR CODE HERE*/
*** ** * * * * *** ** * * ***** * *
* ** **** * *** (c=0;c<n;c++)
*** **** ***** *** * **** ** *** ***** ** * * * ** ** * * *** * **
* *** ** * * ** * * OF YOUR CODE*/

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

** ** * * * * * * ***** 0;
}
answered by (-249 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
* * * * 2: * * * *
** **
0
0
** *
* * ** ** * *** * * *** * ** of * * ** * ** * ** * ** * * * * * * ** ** * ** * * or F, * ** * * ** *** or *** *** * ** n is * ** of * *

** *** ** * * * *** * * = 4, B = 3, C = 2, D = 1, F = 0)

** ** *** * *
*** ***** ** * * * ** n)
{
* *** ** ** * *** * * * ** * *


* * * ** * * ** **** OF ** *
** * * ******* * ***** ** * ** the * * of the * * * ** * * * * * and
}

* * *
{
* * * *** * ****
* ***** * *** * * n;

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


* * ** *** ** ** * OF *

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

* * ** * ** **** * ** 0;
}
****

** * * * is * * * of * * to ** * ** The ** **** *** *

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

4
A B C D
* * **

**
*** You * *** * * ** ** be ** **
answered by (-336 points)
0 0
prog.c:1:1: error: expected identifier or '(' before numeric constant
 12-14 Exercise 2: Calculate GPA
 ^~
prog.c:5:4: error: stray '\347' in program
 22 \xe7\x80\x8f\xe8\xa6\xbd
    ^
prog.c:5:5: error: stray '\200' in program
 22 \xe7\x80\x8f\xe8\xa6\xbd
     ^
prog.c:5:6: error: stray '\217' in program
 22 \xe7\x80\x8f\xe8\xa6\xbd
      ^
prog.c:5:7: error: stray '\350' in program
 22 \xe7\x80\x8f\xe8\xa6\xbd
       ^
prog.c:5:8: error: stray '\246' in program
 22 \xe7\x80\x8f\xe8\xa6\xbd
        ^
prog.c:5:9: error: stray '\275' in program
 22 \xe7\x80\x8f\xe8\xa6\xbd
         ^
prog.c:6:225: error: stray '\345' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                 ^
prog.c:6:226: error: stray '\244' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                  ^
prog.c:6:227: error: stray '\247' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                   ^
prog.c:6:228: error: stray '\345' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                    ^
prog.c:6:229: error: stray '\257' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                     ^
prog.c:6:230: error: stray '\253' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                      ^
prog.c:6:231: error: stray '\345' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                       ^
prog.c:6:232: error: stray '\260' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                        ^
prog.c:6:233: error: stray '\217' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                         ^
prog.c:6:234: error: stray '\345' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                          ^
prog.c:6:235: error: stray '\257' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                           ^
prog.c:6:236: error: stray '\253' in program
 Finish the function compute_GPA below. The function should return the average of the grades (assume that A=4,B=3,C=2,D=1, and F=0). The grades array will contain letter grades (A,B,C,D, or F, either upper-case or lower-case \xe5\xa4\xa7\xe5\xaf\xab\xe5\xb0\x8f\xe5\xaf\xab), n is the length of the array
                                                                                                                                                                                                                                            ^
prog.c:8:1: error: stray '\345' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
 ^
prog.c:8:2: error: stray '\257' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
  ^
prog.c:8:3: error: stray '\253' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
   ^
prog.c:8:15: error: stray '\345' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
               ^
prog.c:8:16: error: stray '\207' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                ^
prog.c:8:17: error: stray '\275' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                 ^
prog.c:8:18: error: stray '\346' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                  ^
prog.c:8:19: error: stray '\225' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                   ^
prog.c:8:20: error: stray '\270' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                    ^
prog.c:8:21: error: stray '\343' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                     ^
prog.c:8:22: error: stray '\200' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                      ^
prog.c:8:23: error: stray '\202' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                       ^
prog.c:8:24: error: stray '\345' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                        ^
prog.c:8:25: error: stray '\207' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                         ^
prog.c:8:26: error: stray '\275' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                          ^
prog.c:8:27: error: stray '\346' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                           ^
prog.c:8:28: error: stray '\225' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                            ^
prog.c:8:29: error: stray '\270' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                             ^
prog.c:8:30: error: stray '\346' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                              ^
prog.c:8:31: error: stray '\234' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                               ^
prog.c:8:32: error: stray '\203' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                ^
prog.c:8:39: error: stray '\346' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                       ^
prog.c:8:40: error: stray '\210' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                        ^
prog.c:8:41: error: stray '\220' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                         ^
prog.c:8:42: error: stray '\347' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                          ^
prog.c:8:43: error: stray '\270' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                           ^
prog.c:8:44: error: stray '\276' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                            ^
prog.c:8:45: error: stray '\345' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                             ^
prog.c:8:46: error: stray '\271' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                              ^
prog.c:8:47: error: stray '\263' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                               ^
prog.c:8:48: error: stray '\345' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                                ^
prog.c:8:49: error: stray '\235' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                                 ^
prog.c:8:50: error: stray '\207' in program
 \xe5\xaf\xabcompute_GPA\xe5\x87\xbd\xe6\x95\xb8\xe3\x80\x82\xe5\x87\xbd\xe6\x95\xb8\xe6\x9c\x83return\xe6\x88\x90\xe7\xb8\xbe\xe5\xb9\xb3\xe5\x9d\x87(A = 4, B = 3, C = 2, D = 1, F = 0)
                                                  ^
In file included from /usr/include/stdio.h:74:0,
                 from prog.c:10:
/usr/include/libio.h:302:3: error: unknown type name 'size_t'
   size_t __pad5;
   ^~~~~~
/usr/include/libio.h:305:67: error: 'size_t' undeclared here (not in a function)
   char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
                                                                   ^~~~~~
/usr/include/libio.h:333:62: error: expected declaration specifiers or '...' before 'size_t'
 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
                                                              ^~~~~~
/usr/include/libio.h:342:6: error: expected declaration specifiers or '...' before 'size_t'
      size_t __n);
      ^~~~~~
/usr/include/libio.h:464:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_IO_sgetn'
 extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t);
                   ^~~~~~~~~
In file included from prog.c:10:0:
/usr/include/stdio.h:339:20: error: expected declaration specifiers or '...' before 'size_t'
       int __modes, size_t __n) __THROW;
                    ^~~~~~
/usr/include/stdio.h:388:44: error: expected declaration specifiers or '...' before 'size_t'
 extern int snprintf (char *__restrict __s, size_t __maxlen,
                                            ^~~~~~
/usr/include/stdio.h:392:45: error: expected declaration specifiers or '...' before 'size_t'
 extern int vsnprintf (char *__restrict __s, size_t __maxlen,
                                             ^~~~~~
/usr/include/stdio.h:711:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fread'
 extern size_t fread (void *__restrict __ptr, size_t __size,
               ^~~~~
/usr/include/stdio.h:717:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'fwrite'
 extern size_t fwrite (const void *__restrict __ptr, size_t __size,
               ^~~~~~
prog.c:34:1: error: unknown type name 'Example'
 Example input:
 ^~~~~~~
prog.c:34:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
 Example input:
              ^
prog.c:36:68: error: unknown type name 'The'
 The first input is the number of elements need to compute GPA (4); The array values follow;
                                                                    ^~~
prog.c:36:78: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'values'
 The first input is the number of elements need to compute GPA (4); The array values follow;
                                                                              ^~~~~~
prog.c:36:78: error: unknown type name 'values'
prog.c:38:1: error: stray '\347' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
 ^
prog.c:38:2: error: stray '\254' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
  ^
prog.c:38:3: error: stray '\254' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
   ^
prog.c:38:4: error: stray '\344' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
    ^
prog.c:38:5: error: stray '\270' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
     ^
prog.c:38:6: error: stray '\200' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
      ^
prog.c:38:7: error: stray '\350' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
       ^
prog.c:38:8: error: stray '\241' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
        ^
prog.c:38:9: error: stray '\214' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
         ^
prog.c:38:10: error: stray '\346' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
          ^
prog.c:38:11: error: stray '\230' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
           ^
prog.c:38:12: error: stray '\257' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
            ^
prog.c:38:13: error: stray '\346' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
             ^
prog.c:38:14: error: stray '\210' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
              ^
prog.c:38:15: error: stray '\220' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
               ^
prog.c:38:16: error: stray '\347' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                ^
prog.c:38:17: error: stray '\270' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                 ^
prog.c:38:18: error: stray '\276' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                  ^
prog.c:38:19: error: stray '\346' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                   ^
prog.c:38:20: error: stray '\225' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                    ^
prog.c:38:21: error: stray '\270' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                     ^
prog.c:38:22: error: stray '\347' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                      ^
prog.c:38:23: error: stray '\233' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                       ^
prog.c:38:24: error: stray '\256' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                        ^
prog.c:38:25: error: stray '\357' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                         ^
prog.c:38:26: error: stray '\274' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                          ^
prog.c:38:27: error: stray '\214' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                           ^
prog.c:38:28: error: stray '\347' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                            ^
prog.c:38:29: error: stray '\254' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                             ^
prog.c:38:30: error: stray '\254' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                              ^
prog.c:38:31: error: stray '\344' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                               ^
prog.c:38:32: error: stray '\272' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                ^
prog.c:38:33: error: stray '\214' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                 ^
prog.c:38:34: error: stray '\350' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                  ^
prog.c:38:35: error: stray '\241' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                   ^
prog.c:38:36: error: stray '\214' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                    ^
prog.c:38:37: error: stray '\346' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                     ^
prog.c:38:38: error: stray '\230' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                      ^
prog.c:38:39: error: stray '\257' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                       ^
prog.c:38:40: error: stray '\346' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                        ^
prog.c:38:41: error: stray '\210' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                         ^
prog.c:38:42: error: stray '\220' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                          ^
prog.c:38:43: error: stray '\347' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                           ^
prog.c:38:44: error: stray '\270' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                            ^
prog.c:38:45: error: stray '\276' in program
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                             ^
prog.c:38:48: error: expected ')' before '/' token
 \xe7\xac\xac\xe4\xb8\x80\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe\xe6\x95\xb8\xe7\x9b\xae\xef\xbc\x8c\xe7\xac\xac\xe4\xba\x8c\xe8\xa1\x8c\xe6\x98\xaf\xe6\x88\x90\xe7\xb8\xbe(A/B/C/D/F)
                                                ^
0 like 0 dislike
Hidden content!
#include * * ** **
#include * * ********
float compute_GPA(char grades[],int n)
{
* *** * * * * * ** ***** j;
* ** * * * *** t=0,avg;
* ***** ** * * * *** * **
** ** *** *** * * ** ***** * * * * *** ** * * **
** * ***** * *** ** **** ** ** * **** ******* * ** || grades[j]=='a') t+=4;
**** * * * * ** ** ** * ** **** *** **** *** * ** * * * || grades[j]=='b') t+=3;
** * ** ** * ** **** ** ** * * ** ****** * * ** ** ** * || grades[j]=='c') t+=2;
*** ** * ** ** ** ** * ****** * * * * * ** * *** * grades[j]=='d') t+=1;
**** * * ** ** **** * * ** * ** ** ** ****** * * ** ** || grades[j]=='f') t+=0;
** * * ** * *** ** * *** * *****
** *** * * * *** * * ** *** * ** ***** *
return avg;

* ******* **** function should return the average of the grades(assume that A=4,B=3,C=2,D=1, and F=0).
}

int main(void)
{
** ** * * **** G[100];
* * * * ****** * n,i;

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


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

**** * * * * * 0;
}
answered by (-301 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include * *** ** **
float ** * * * grades[],int n)
{
**** * * ** * **** ** YOUR CODE HERE*/
int i;
int p=0;


for ** * *
{
switch (grades[i])
{
* * * * *** 'A':
** * ** **** 'a': {
** *** * * ** * * * *** *****
* ****** * ** *** * * * ** ** * ** ** ** *
** *** * *** 'B':
**** * * * 'b':{
* * * ** **** * * ****** * * *** * ** *
* ** * * * * * *** * ** ** *
**** ** * * ** * 'C':
** ****** ** * * 'c':{
** ** ** **** * * * * **** * * * * *
*** *** * * * * * * * ** ** **
* ***** *** *** **** 'D':
*** ** ** ** 'd':{
* * **** *** *** * * * * ****
**** ** ** * * ** * ** * **** * ****
* * * **** * * 'F':
*** * ** * ** * 'f':{
* * * ** * * *** ****** *** * **
}

}
return p;
* * * ** ** * OF YOUR CODE*/
* * * ** * * ** function should return the average of the * that * * * **** * and F=0).
}

int main(void)
{
* * ** * * * * * G[100];
*** ** * * * ***** n;

** ** * ** *** YOUR CODE HERE*/
*** * *** ******** * * * *** * * **
int i;
* * * ( i = 0 ; i < n ; i++ ) ** * *** * * * * **** array A
* * ** * * *** * ** ** * *
* * * * * * * * * *** *** * ** *** **** *** * ***** ** * ***** *** ** ** *** **
* ******** ******** ** * * * * ****
** * ** *** * **** OF YOUR CODE*/

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

* * *** * * * 0;
}
answered by (-336 points)
0 0
Case 0: Wrong output
Case 1: Correct output
Case 2: Wrong output
Case 3: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
float compute_GPA(char grades[],int n)
{
** *** * ** ** * ** a;
* *** * * *** g=0;
**** ** * ** ** * ** *** *** ** ***
   {
*** * * * * ** * **** **** ** ****** ** ** * * * ****
** **** * *** ** ** * ** * * * * * ***** ** * **
**** ** ******* * * ** * * * * * ** if(grades[a]=='B'||grades[a]=='b')
* *** **** * * * *** * * ** * ***
** * *** ** ** * * ** * * * *** * ** * * ** * * * * **
* ****** * **** * * ** ** * ** * ** ** * **
*** ** ** * * * ** ***** * * ** * * *** * ** * **** ** * *
*** *** ** ** *** * * * * * * **** ** *
* ******* ** ** ** ** ** *** ** * ** * *** **
* ** * ** **** * ** *** * * *
   }
** *** * * * *
* ** * *** * * * g;
}

int main(void)
{
*** ** * * **** * G[100];
   int n,i;
* * * * * * * * ** ** ** * * ** *
*** * **** ** * ** * *
   {
* * ** ** * ** * ****** * *** * **** *** ** * ** * * **** * * ***
   }
* * ** ****** ****** * * * * ******** * * *
* ** * ***** *** * 0;
}
answered by (-498 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
float compute_GPA(char grades[],int n)
{
    int i;
    float sum=0;
***** * * ** ** ** * * * ** * * ** *
** * * * ** * * * * * **** * * *
** * * *** ***** * ** * ** ******* ** * *
****** *** * ** * ********* ** * * * ****** ** * * * * ***** *** ** 'A':   sum+=4;
* * **** * ***** * * * *** * *** * * ** ** **** * * ** * ** * ** **** * *** * * ** ** * ** ** * * ** * *** * * ** * *
** ** * * ** ** ** * * ******* ***** ** * * * ** ** ** * * * * * ***** 'a':   sum+=4;
*** **** ** * ** *** ** ** ** * * * * * *** * * * * ** *** * *** **** ** ** * *** ****** *** * *** * **** ** ** ** ** ****** * ****** *
*** ** * * *** ** * * * * ** * ***** ** * ** * *** ** * *** * 'B':   sum+=3;
** * ** ** **** * ** *** * *** * **** *** * *** * ** * ** ** *** * * * * * * ** ** **** *** * * * **** **** * * * * * *** ** *
*** * * ** * ** * * * * * * **** **** * **** ** * * ** * ** * 'b':   sum+=3;
* * ** * *** * * * ** *** * * *** ** ** * * ** ** * ** * * *** **** * ** * * * * * *** ****** * * * * * * ****** ** * * * *
** ** *** ** * * * ** * * **** * **** * * ******* * * ** *** * 'C':   sum+=2;
* *** ** * ** * * * ** ** *** * * ** * * * * * * * ** * ****** *** **** * * * ** ***** *** * *** * ** ** * *** *** **
* * ** *** ** *** * ** ** ** ** ** *** * *** * * ** **** * * * 'c':   sum+=2;
* ******* ** * * * *** **** *** * * ** * ** ***** * * * * ** * ** *** *** * ** * ** **** * ** * * * ** * *** *** * *** ** ******
** ***** * ** *** * *** ** * ********* **** **** * *** ** ** ** 'D':   sum+=1;
* ** *** *** * * * * **** * ******* ** * * * * ** ******* * * ** *** *** * * * ** *** * **** * * * ** * ** *** * * * ***** *
****** ** * ** * ** ** ** ** ** * ** ** * * * * * * ** * 'd':   sum+=1;
** * **** * ** * ** * ** ** * ** *** * * ** **** *** ** * ** * * **** ***** ** *** * ****** ** ** ***** * * *** **** * * *
* *** * * * * * * ** * ** * **** ** ** * * ** * ***** * ******* * *****    sum+=0;
* * ** *** ** * **** ** ** ** ** *** * * ** ** ** ** * * ** * ** * * * * *** * ** * **** ** **** *** *** *** * *****
*** * * * * * * * * *** * * *** * *** *
    }
    sum=sum/n;
    return sum;
}

int main(void)
{
    char G[100];
    int n,i;
* * * *** * * ** ** *** **** *** ",&n);

    //gets(G);
    //puts(G);
** ***** * * * * *** *** * **
** * ** ***** ** *** * ** ** *** ****** *** ** **** ** * ** ****
** * ** * * * **** * *** * * ** ** **** * ** * ** * *** * * * *

    }
****** * **** **** * *** ***** * ** *** * *** ********

    return 0;
}
answered by (54 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
float compute_GPA(char grades[],double n)
{
**** * ** * * * YOUR CODE HERE*/
** * * ** * * * ** c;
*** ** ** ** *** *** * **** * sum,avg;
* * ** ** * ******** * * (c=0;c<n;c++)
** * * * * * **
*** * ** * *** **** * ** * *** *** ** * ** (grades[c]=='A')
** * ***** * **** * * **** * * ***** * * * * * * ** ** *** ******
***** **** ** *** * *** * ** *** * ****** if (grades[c]=='B')
*** *** * *** * * * ** **** * *** * ** *** * * ** ** ** * ****
** * * *** * **** * * ******** * * ** *** if (grades[c]=='C')
** * * * *** * *** *** *** *** ***** * * * * ** ** * * * ** * * **
* * * *** * * ** * ** * * ** *** * ** * if (grades[c]=='D')
** * *** ** ** ****** ** * * **** * * * * ** ** * **
*** ** * * ** ** **
**** **** **** * *
* * * * * * ** ** ** avg;
** * ****** * ** * OF YOUR CODE*/
* * * ** **** ** function should return the average of the grades(assume that A=4,B=3,C=2,D=1, and F=0).
}

int main(void)
{
* * * ** ** *** G[100]={};
** ** ** ** * n,c;

** * ** * ** ** * * * YOUR CODE HERE*/
* * * * * ** * * * * ******** ** * * * * * *
*** ** * * * * (c=0;c<n;c++)
* *** ********* * **** * * ** * * ***** * *** **** ** **
* * * ** * * * OF YOUR CODE*/

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

* *** **** ******** ** 0;
}
answered by (-249 points)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
0 like 0 dislike
Hidden content!
#include <stdio.h>
float compute_GPA(char grades[],int n)
{
   int i;
* *** * ** ** * avg,j=0;
**** * ** * **** ** * *
   {
** **** * * * * * ** * ** ** * ** * * * * ** *
* * * **** * ** * *** * ** * * **
***** **** ***** * ***** * * * ** *** ******* *** *
* * * * ** ** ***** ** ****** * * **
*** ** ***** * *** ** * * * *** ** ** * * if(grades[i]=='B'||grades[i]=='b')
** * ***** * * * *** **
** ** ** * ** * * *** * ** ** *** * ***** * * **
*** * * * * * * * * *** * **
* * * * * * * ******* ** *** *** ** * ** * ** * *
* ** * * *** ** ** ** **** * ** ** *
* * * * ** ** **** * * * * * * * **** ** * ** ** * ***
** *** * * ** * ** ********* * ** **
* * ** ** *** * * * * * * *** ** * * * * ****** * * * ** * ** * * ***
* ** * ** **** ** * * ****** * *
* *** ********* *** ******* ** *** ***** *** ** * * *** ** * * * * ***
** *** **** ** * * * * ** *** *
** * *** ** ** *** * * ** * ** * * *** * if(grades[i]=='F'||grades[i]=='f')
* * ***** * * **** ** * * * ** ** * *
* * ********** * * * * * * **** ***** *** ** ** * * * *********
* ** * * **** ** * * * * ** **** ** *** *
   }
* *** * * * ** **** **
* ** ******* * ** avg;
** * * * * * ** * * * function should return the average of the grades(assume that A=4,B=3,C=2,D=1, and F=0).
}

int main(void)
{
** * * ** *** * G[100];
   int n;
   int i;
*** * **** * * * * * ** * * ** ****
* * *** ** * * ** *
   {
* * **** * *** * ** * *** * *** ** * * *** **** * * ****
   }
* ** ** * * * * * * ** ** * * ** *

** *** * * * * 0;
}
answered by (-255 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.17.99
©2016-2025

Related questions

0 like 0 dislike
38 answers
[Exercise] Coding (C) - asked Dec 13, 2017 in Chapter 9: Functions by semicolon (5.2k points)
ID: 37277 - Available when: 2017-12-14 18:00 - Due to: Unlimited
| 5.5k views
0 like 0 dislike
41 answers
[Exercise] Coding (C) - asked Dec 14, 2017 in Chapter 9: Functions by semicolon (5.2k points)
ID: 37370 - Available when: 2017-12-14 18:00 - Due to: Unlimited
| 5.9k views
0 like 0 dislike
45 answers
[Exercise] Coding (C) - asked Dec 7, 2017 in Chapter 9: Functions by semicolon (5.2k points)
ID: 35784 - Available when: 2017-12-07 18:00 - Due to: Unlimited
| 6.8k views
12,783 questions
183,442 answers
172,219 comments
4,824 users