Toggle navigation
Courses
Questions
Tags
Users
AC 20161027 期中考 1
1
like
0
dislike
7.1k
views
請設計一程式,由使用者輸入N個數字,求這些數字的平均。使用者輸入的第一個數字N代表接下來會有多少個數字要求平均,接下來的N個數字就是需要計算平均的數。輸出請輸出到小數點後六位。
sample input:
10 1 2 3 4 5 6 7 8 9 10
sample output:
5.500000
[Exercise]
Coding (C)
-
asked
Oct 27, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 15378 -
Available when:
2016-10-27 18:30:00
-
Due to:
2016-10-27 21:00:00
edited
Oct 27, 2016
by
Shun-Po
|
7.1k
views
comment
0
1
Called for Help
0
0
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,n;
float c;
scanf("%d",&a);
int b[a];
for(n=0;n<a;n++)
{
scanf("%d",&b[n]);
}
for(n=0;n<a;n++)
{
c=c+b[n];
}
printf("%.6f",c/a);
return 0;
}
Please
log in
or
register
to add a comment.
102
Answers
0
like
0
dislike
Hidden content!
********* * * * ***
int main()
{
* *** * * ** * * * * * a, num;
* ** * ** * * * * ** ***** &num);
******** ****** * *** ** ** k <= num ; k++ )
* ** * *** *** *** ** ** *
* *** * **** ** * *** ** * ** **** **** *** *** = sum+sum ;
* * * **** * * * * **** ** ** * **** *** = num + 1 ;
** *** ** * ** ***
* * * ** * * ***** = sum / num ;
**** * * ** * ** ** * ******* sum);
}
answered
Oct 27, 2016
by
林宗鴻
(
-72
points)
reshown
Nov 18, 2016
by
林宗鴻
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include ***** **** *
** * * * ** *
#include ** ** ** **
int main()
{
* * *** ** ** ** a;
* ** * ***** ** * * * * * * * **
*** * ****** * * * * num[a];
* * * ** * * ** * ** i, sum, av;
** ****** ***** * * *
* ** * ****** * * * * ***** **** **
** * **** * ****** * ** *
*** ** * **** = sum + num[a];
av = sum / a;
* * * ** * ** av);
return 0;
}
answered
Oct 27, 2016
by
林恆毅
(
46
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
main()
{
***** ** ***** * * N,num[N-1],i;
* *** ***** ** * *** ** * * ***** *** &num[N-1]);
****** * ** ***** * ** *** ;N--)
********* * *
*** ***** * * * * ** ****** **** ** * * *
** * *** * * ** **** *** **** *** ***** ***** * *
*** *** ** * ***** *
** ** ** ** ** * * 0;
}
answered
Oct 27, 2016
by
410523040
(
-40
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
** ** ** * * ** *
* ***
{
** ***
** * *
* * k;
* **
* **** *** ** ** * *
* * * * **
* *
}
n = sum / k ;
**** * *** *** ** * ***
* 0;
}
answered
Oct 27, 2016
by
rickyliu
(
-50
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include ***** * *** *
#include <math.h>
main()
{
* ** ** ** ** ** ** n, i, k;
* * * *** * ***** * i = 1; i <= n; i++)
* * ******** **
** ** * * * ** ** ***** ** ** *** * ***
*** * ** ** ** * ** * ** * * k);
***** * ** ** * * ** = sum + k;
* ***** * * **
**** * ****** * * *** sum \n;
**** * * * * *
** * * * ** ** main()
** * ** * *** ** ****
*** *** ** ** * * n;
*** * **** * * * ave;
* ** ** * * ** * ** ** ** * ** * ** * **** * *
** **** *** * * * * ** >> n;
* *** * ** = n
*** *** ******* * ** *** ****** *** * * *
** * * * **
answered
Oct 27, 2016
by
wilson0121
(
-74
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
* ** * * ***
* ** * * ** * * **
int main()
{
*** ** ** *
******* * ** **** * ***
* ** ** **
**** * * ***** * ** *
return 0;
}
answered
Oct 27, 2016
by
羅祖嘉
(
-248
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>
int main()
{
* ** * * ** * *** * ** i,a[100],k=0,c,d;
** *** * ** * * * * * * * * ** *** ** * ***
* ** ** * ****** * * **** * *** **
* * ** * **** ** ** **
**** * * * * ****** **** ** ** *** ********** * * ** * * ** ** * * * * ** * *** *** ** * ** ***
** * ** *** ** ****** * * * * ** ******* ********
* * *** ** *** * ** *
* ****** * *** ** * * **** **** **** ** * ** * *
* * * * * * * ** ** * 0;
}
answered
Oct 27, 2016
by
410323020
(
-85
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
#include <stdlib.h>
int main()
{
* * * ** **** * * * **** i,a[100],k=0,c,d;
** ** * * ** ** ** * ** * * * * *
** * ** *** * * * * *** * * ***
** * * ** ****** * *
* ** * ******* ** * ******* * ** * * ** *** ** *** * * ** ** ** ** * ** * * ********** * * ** ** * ****
** * ** * * * ** **** *** * * *** * ** * *
** * ** **** ** **
*** * ** ** *** *** * ** * *** ** * * **** **
* ** *** * * *** * 0;
}
answered
Oct 27, 2016
by
410323020
(
-85
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include<stdio.h>
main()
{
int i,num[i],n,sum,a;
* ** ***** *** **** *** *
** ** * **** * * * * **** **
**** ****** ** * * * ** * **
**** * * *** ** * * * * * * *** *** * *
** ** * ** *** * * ***
* ****** *** ** * ** ******* ****
* **** * * * * *********** * * * * ** * * ** *
*** ******* * *** ***** 0;
}
answered
Oct 27, 2016
by
Queenie0915
(
-124
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
* ***** ** ** *** *
* *** ** ** * * *
int main()
{
long a = 0,b[100] = {0},c = 0,i = 0,j = 0,k = 0,l = 0;
long p = 0;
* * *** * * * * *
** * ******
***** * **** ** * * * *
* * * * * ** ** *
* * * ** * ** *
* *** * * * * *
**** * **** * * = 0;
* **** ** * * *** ** **
{
* ** *** ***** **** * *** * ** * * *
* * * * * * * ** * * ** * ** * * ** * ** ***** *
* ** ** ** * * *** * ** * ** *** * * ***** *** * * = b[l];
* * * ******** * * ** ** * **** * ** * *** ***** * * * * ** * * = b[i];
* ** ** * ** * * * *** ******* ** * **** *** * *** * = k;
**** ** ***** * * ** ** * ** * * * *** **** *
* *** * *** ** ** * *
}
if(a%2==0){
i = a/2;
j= a/2+1;
p = * ** * **
* ** * ** *** * ***
}else{
i = (a+1)/2;
* ** ** ** ** **
}
return 0;
}
answered
Oct 27, 2016
by
SRFX
(
-140
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
1
2
3
4
...
11
next »
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English
中文
Tiếng Việt
IP:172.69.17.190
©2016-2025
Related questions
0
like
0
dislike
0
answers
AC 20161027 期中考公告
[Resource]
asked
Oct 27, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 15475 -
Available when:
Unlimited
-
Due to:
Unlimited
|
13
views
0
like
0
dislike
5
answers
AC 20161027 期中考 10
[Exercise]
Coding (C)
-
asked
Oct 27, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 15447 -
Available when:
2016-10-27 18:30:00
-
Due to:
2016-10-27 21:00:00
|
925
views
1
like
0
dislike
37
answers
AC 20161027 期中考 9
[Exercise]
Coding (C)
-
asked
Oct 27, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 15446 -
Available when:
2016-10-27 18:30:00
-
Due to:
2016-10-27 21:00:00
|
3.1k
views
1
like
0
dislike
17
answers
AC 20161027 期中考 8
[Exercise]
Coding (C)
-
asked
Oct 27, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 15442 -
Available when:
2016-10-27 18:30:00
-
Due to:
2016-10-27 21:00:00
|
1.6k
views
1
like
0
dislike
18
answers
AC 20161027 期中考 7
[Exercise]
Coding (C)
-
asked
Oct 27, 2016
in
2016-1 程式設計(一)AC
by
Shun-Po
(
18k
points)
ID: 15440 -
Available when:
2016-10-27 18:30:00
-
Due to:
2016-10-27 21:00:00
|
1.6k
views
12,783
questions
183,442
answers
172,219
comments
4,824
users