Toggle navigation
Courses
Questions
Tags
Users
AC 20161102 作業1
2
like
0
dislike
3.9k
views
請設計一程式,使用者輸入一個正整數N,程式會輸出相對應的費氏數列第N項。
sample input:
10
sample output:
55
[Exercise]
Coding (C)
-
asked
Nov 2, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 16861 -
Available when:
Unlimited
-
Due to:
Unlimited
|
3.9k
views
comment
1
2
Called for Help
Please
log in
or
register
to add a comment.
44
Answers
0
like
0
dislike
Hidden content!
#include <stdio.h>
int ffff(int fa){
*** * *********** * ***** t1=1,t2=2,i,back=0;
* * ** ** ** *** * * * ** ** (fa==1 ||fa==2){
** * *** * * ** *** * * ***** **** ** * * * * 1;
}
* ** **** * ** * ***** **
** **** * ** * *** * * * * * ** * ** *** * **** *
** * * **** * * ** * * **** *** *** ***** ** ** * **** ** *
** * *** * ** ** * * * ***** * * * ** * * *** * *** * *** ****
** ** * ** * ** * ** * * * ** * * * * * *** *** * ** *** *** * * * **
* * ** **** * * ******** *** * * ** ****** * ***
* ** * ** *** ** ********* * * ** * ** * ** *** *** back;
* **** * ** * * **** * * **
}
int main(){
** * * * * ** ** * a=0;
* ** *** * * *** *** * * **** ** * * ** * *
* *** ** ***** * * * *** * ** ** **
* * * * * * * *** * ** 0;
}
answered
Jan 1, 2017
by
shihemi
(
-82
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()
{
* *** **** * * ** ** ** n,a,b,i,t;
***** * * * * * ** ** * * ** **
* * * *** ** ** * * ** *
** * * * ** ** ****
* ** ** **** ** *
*** ** ****** **** * ** ** ** ** ** **
{
** ** ** ** ** * * * ****** * * * * ****
* ** * **** * * * * ** * * * ***** ** * ** * **
* * * **** ***** **** * *** * * *** *
}
* *** * * * * * * * (n<=2)
* * * **** * **** * ***** * *** * ** * **** * * *****
* ** * * ** * * *** ** * if(n>2)
*** ** ****** ** ** ******** * * ** * ***** * ******* ***** *
* * ****** *** ** ** ** 0;
}
answered
Jan 1, 2017
by
410323020
(
-85
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
*** ** *** * * *
* ** * * **
* * * ** ****
int fib(int number)
{
int a, b = 1, c = 1, f =0;
if (number <= 0)
*** ** * * ** * * * ** * * ****
* ** * * * * ** ** ***** * * * * ***** * *
** * * * * ** ** ** * * * ** * ** ** ** ** * 0;
** * * *** ** * * ** * **
* *** *** * * ** * ** *** if (( number == 1)||( number == 2))
* * ** * ** * * ********* * *** * ** 1;
* * * * *** * *** *** *** ****
* * ** *** * **** * ***** **
* ******** * * *** **** ******* * (a = 3; a <= number; a++)
** ** * ** * * * * * * * *
**** **** *** * * *** ** ** ** ** ** = b + c;
* ** * * * *** ***** **** ** ***** = c;
** * * * *** ** * *** * * ** * ** = f;
* ** * **** ** ** * * * * ** *
** **** * ** * * ** * ** * * *
* *** * * * ** *** * * ** * f;
}
int main()
* ** ** * * * * **
* * * * * * **** ** num, fibon;
* * **** ** **** * ** ** * * ** &num);
** *** *** * **** * ** * = fib(num);
* ** ** * * * **** * ** * ** * * * fibon);
*** * **** ****** *** ** ** ** *** * ***
return 0;
}
answered
Nov 30, 2016
by
s31102
(
-100
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include *** ** * *
****** ** * * * **
int fib(int);
int main()
{
** * ** * * * ** * n;
* * * ** * * ** * * * *** * ** * * * ****
* * * ***** *** ** ** * **** * **** ***
* * ** ** * * * 0;
}
int fib(int n)
{
* * ** *
***** * * ** *** * 1;
* * *
* * **** **** *** * * ***** ** ** *
}
answered
Nov 26, 2016
by
李奕叡
(
-143
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include * ** * *
#include * * *
#include ** ** ***
#include <math.h>
* ** * * *** ***
int main()
{
** *** * **** n , i , j ;
** ** ***** ** *** *** * * *** ** ** * ** *
*** *** ***** ** * * num[n];
* * * **** * * * *** * = 1;
* **** *** * * * ** = 1;
* * ****** * **** ** ** ** ** *** * ****
*** *** ** * **** *** ** = num[i-1] + num[i-2];
* * * ** *** * * ** * *
* *** ** * * ** ** * * ******** * * *
** * *** * * ** 0;
}
answered
Nov 15, 2016
by
loyfree0706
(
-216
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(){
**** ** * * * sum, num;
* * ** * * *** ** *** ** ** * * &num);
* * **** * **** * * ** * = fib(num);
***** ** ** * * *** *** **** **** ** * * * sum);
** * ** * * * * a, b, big;
***** ** * * ** * * *** * * * ** * * ** * &a, &b);
* * * * ** ** * *** *** ** = bigger(a,b);
* ** *** * ** ** * ** * *** big);
* * * *** *** * ** **** * * 0;
}
int fib(int a){
** * **** **** * * i, num1=1, num2=1, fi=0;
* * * **** * * * ** ** * * **
* * ***** * * * * * * *
****** * *** ** *** * * *** * * ** **** * ** ** *** * * enter a positive number.");
* ** *** * ** *** * **** ****** * * * * * ** * 0;
}
****** * **** * * **
**** ** **** ***** * ** *** * ** * ** * * || (a==2))
* * * *** ******* ** ** * ** * *** ** * ** ** *** 1;
******* * **** *** * *** ***
{
* *** * * * ** ** * * ** *** *** * * * i<=a; i++)
* *** ***** ** * ** * * ** *** **** * ** ** * * **** *** ******* *
* ** ** * * **** ** * * *** * * * ** * *** ** * ****** ** ** * ** * *** * * ** = num1 + num2;
** **** * * * * * * ** ** * * ** ** ** * * ** *** * ** * * * = num2;
* ** * * *** ** ** ** ***** ** ** * * ** * * * * * *** * ** *** * * ** ** * * ** * = fi;
* * ** * * ** * ***** ** **** * ***** * ** * * *** *** * ****
******* *** * *** ****
* * * *** *** * * **** ** fi;
}
int bigger(int numa, int numb){
* ** * * * * * ** (numa>numb)
** * *** *** ** ** *** *** ** ** ** * * ** * numa;
** ***** ** ** **** *
* * **** * * ** *** **** **** ** * * numb;
}
answered
Nov 9, 2016
by
paulinelyq
(
-64
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include * * *** ******
#include *** * * *
int main(void)
{
** *** ** ** ** ** ** a = 123, b = 456;
** * ** * * ****** *ptr_a, *ptr_b;
* * * **** **** *** * * =
** * * * ** *** = *** ** *
* * ** * * * ** * * ** = * * * *ptr_a, ptr_a);
* * * **** * *** * * = ******** *ptr_b, ptr_b);
** * * ** *** **** ***** * * *** * * ** *
** * * ** ** * * * *** 0;
}
answered
Nov 9, 2016
by
paulinelyq
(
-64
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include *** *** * *
#include * *** * * *
#include ** * *** ** *
int ** * (int number)
{
** * * **** ** *** * fibon, num1 = 1, num2 = 1,i;
* *** ** * * *** * * * ** 0)
* *** ***** ****** * *
** * ** *** ** * ****** ** ** 0;
** ****** *** * * ***
** ** * *** *** * ** * * ** * *** * == 1|| number == 2))
* * * * ** *** *** * *** ** ** 1;}
* **** ** ** * * * ** * ***
** **** *** ** ***
* * * ** * * ** * ** i <= number; i++)
*** * *** ** * * * * *
** * * ** *** *** * * = num1 + num2;
* ***** * * * * * ** = num2;
* * *** ** ** * ** * ** = fibon;
* ***** * * * * * **
* ** **** * * * * ** fibon;
}
}
int main()
{
* * * num, fi;
** *** * ***** *** * * * * * *
* ** * = * * ** *
* *** ** * * ** * * * * fi);
** * * *** * 0;
}
answered
Nov 9, 2016
by
410523012
(
-158
points)
ask related question
comment
Please
log in
or
register
to add a comment.
0
like
0
dislike
Hidden content!
#include <stdio.h>
int ffff(int fa){
* ** * ** *** * * ** t1=1,t2=2,i,back=0;
* * **** * * * * * *** (fa==1 ||fa==2){
** * * ****** ** * ** * * * * *** 1;
*** * ** * * * *
*** ** * ** * * * ** ** ** *
* ** * * ** ** * * *** * * ** **** ** ** ** ** ** ****
* * ** * ***** * ** *** * ** ** * ***** * * * *** * *** * *
* ** * * * *** * ****** * * * * ** * * *** * * ********* **
*** ** * * ** * *** * ** ** ** * *** * * ** * * ** * * * * * **
* *** * * ** ** * * * * * * * ** *
* * * * * * ** * *** * * ** * * *** * * ** back;
* * *** *** * **
}
int main(){
** ***** ** * * ** a=0;
* * ****** * * ** * * ******* * * *** * ***
* ** ** * ***** ** * * ***** * * * ** **
***** * * ** * * * 0;
}
answered
Nov 9, 2016
by
HoMingJui
(
-126
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> /*1 1 2 3 5 8 13*/
#include <math.h>
int fi(int num);
int main()
{
** *** * ** *** * ** num=0;
*** * * ** * * ** * ****** * * *** *
**** ** * * *** **
*** * * *** *** ***** 0;
}
int fi(int num)
{
****** *** * **** k=1,i,a=1,b=1,sum=0;
** * * * ** *** * **** ** *** *
** * ** *** * * *** * * ******* * *** ***** * * *
** * *** ***** * *
{
* * ** * ** ** ** **** ** ** ** ** * *
* ***** * **** * * * * ******* ** ** ** *** * ** * * ******* * * * *
* ** ** ** ** * * * ** * * * ****** ** *** *
*** ** * * **** ** ** * * *** * **** * * * ** *** *** * ** * * *** ***
* **** * ** ** * * *** ** * ****** ***** ** ** * * * * *** **
* ** ******** * ** ** * ** * ** * **** * *** *** * * * ** *** ***
}
***** ** ************* ** * ***** ************
}
answered
Nov 3, 2016
by
m8f2617
(
-103
points)
ask related question
comment
Please
log in
or
register
to add a comment.
Page:
1
2
3
4
5
next »
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English
中文
Tiếng Việt
IP:172.70.194.141
©2016-2025
Related questions
1
like
0
dislike
48
answers
AC 20161102 作業2
[Exercise]
Essay (Open question)
-
asked
Nov 2, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 16865 -
Available when:
Unlimited
-
Due to:
Unlimited
|
4.2k
views
1
like
0
dislike
129
answers
AC 20161019 作業 1
[Exercise]
Coding (C)
-
asked
Oct 19, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 14119 -
Available when:
Unlimited
-
Due to:
Unlimited
|
8.6k
views
0
like
0
dislike
117
answers
AC 20161013 作業 1
[Exercise]
Coding (C)
-
asked
Oct 13, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 13581 -
Available when:
Unlimited
-
Due to:
Unlimited
|
7.3k
views
0
like
0
dislike
131
answers
AC 20161005 作業 1
[Exercise]
Coding (C)
-
asked
Oct 5, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 12291 -
Available when:
Unlimited
-
Due to:
Unlimited
|
8.3k
views
0
like
0
dislike
121
answers
AC 20160921 作業1
[Exercise]
Essay (Open question)
-
asked
Sep 21, 2016
in
作業
by
Shun-Po
(
18k
points)
ID: 11340 -
Available when:
Unlimited
-
Due to:
Unlimited
|
7.8k
views
12,783
questions
183,442
answers
172,219
comments
4,824
users