@ -1,18 +0,0 @@
|
|||||||
#include<stdio.h>
|
|
||||||
|
|
||||||
int factorial(int n)
|
|
||||||
{
|
|
||||||
if(n==0)
|
|
||||||
return 1;
|
|
||||||
return n*factorial(n-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
int n,x;
|
|
||||||
printf("请输入你想要求的阶乘的数:");
|
|
||||||
scanf("%d",&n);
|
|
||||||
x=factorial(n);
|
|
||||||
printf("%d的阶乘是%d\n",n,x);
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
#BlueJ class context
|
|
||||||
comment0.target=card
|
|
||||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ card\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
|
||||||
comment1.params=
|
|
||||||
comment1.target=void\ act()
|
|
||||||
comment1.text=\r\n\ Act\ -\ do\ whatever\ the\ card\ wants\ to\ do.\ This\ method\ is\ called\ whenever\r\n\ the\ 'Act'\ or\ 'Run'\ button\ gets\ pressed\ in\ the\ environment.\r\n
|
|
||||||
comment2.params=
|
|
||||||
comment2.target=int\ getValue()
|
|
||||||
comment3.params=
|
|
||||||
comment3.target=boolean\ getFaceup()
|
|
||||||
comment4.params=
|
|
||||||
comment4.target=void\ turnFaceDown()
|
|
||||||
comment5.params=cardValue
|
|
||||||
comment5.target=card(int)
|
|
||||||
numComments=6
|
|
Before Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 623 B |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 457 B |
Before Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 474 B |
Before Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 510 B |
Before Width: | Height: | Size: 610 B |
Before Width: | Height: | Size: 612 B |
Before Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 388 B |
Before Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 440 B |
Before Width: | Height: | Size: 435 B |
Before Width: | Height: | Size: 478 B |
Before Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 513 B |
Before Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 533 B |
Before Width: | Height: | Size: 453 B |
Before Width: | Height: | Size: 630 B |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 474 B |
Before Width: | Height: | Size: 508 B |
Before Width: | Height: | Size: 494 B |
Before Width: | Height: | Size: 578 B |
Before Width: | Height: | Size: 531 B |
Before Width: | Height: | Size: 606 B |
Before Width: | Height: | Size: 625 B |
Before Width: | Height: | Size: 634 B |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 583 B |
Before Width: | Height: | Size: 596 B |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 463 B |
Before Width: | Height: | Size: 511 B |
Before Width: | Height: | Size: 486 B |
Before Width: | Height: | Size: 558 B |
Before Width: | Height: | Size: 520 B |
Before Width: | Height: | Size: 609 B |
Before Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 608 B |
@ -1,46 +0,0 @@
|
|||||||
#Greenfoot project file
|
|
||||||
class.card.image=blueflip.png
|
|
||||||
class.table.image=porkboard.jpg
|
|
||||||
dependency1.from=table
|
|
||||||
dependency1.to=card
|
|
||||||
dependency1.type=UsesDependency
|
|
||||||
editor.fx.0.height=0
|
|
||||||
editor.fx.0.width=0
|
|
||||||
editor.fx.0.x=0
|
|
||||||
editor.fx.0.y=0
|
|
||||||
height=584
|
|
||||||
package.numDependencies=1
|
|
||||||
package.numTargets=2
|
|
||||||
project.charset=UTF-8
|
|
||||||
publish.hasSource=false
|
|
||||||
publish.locked=true
|
|
||||||
publish.longDesc=
|
|
||||||
publish.shortDesc=
|
|
||||||
publish.tags=
|
|
||||||
publish.title=
|
|
||||||
publish.url=
|
|
||||||
readme.height=60
|
|
||||||
readme.name=@README
|
|
||||||
readme.width=49
|
|
||||||
readme.x=10
|
|
||||||
readme.y=10
|
|
||||||
simulation.speed=50
|
|
||||||
target1.height=70
|
|
||||||
target1.name=card
|
|
||||||
target1.showInterface=false
|
|
||||||
target1.type=ClassTarget
|
|
||||||
target1.width=120
|
|
||||||
target1.x=0
|
|
||||||
target1.y=0
|
|
||||||
target2.height=70
|
|
||||||
target2.name=table
|
|
||||||
target2.showInterface=false
|
|
||||||
target2.type=ClassTarget
|
|
||||||
target2.width=120
|
|
||||||
target2.x=0
|
|
||||||
target2.y=0
|
|
||||||
version=3.0.0
|
|
||||||
width=828
|
|
||||||
world.lastInstantiated=table
|
|
||||||
xPosition=271
|
|
||||||
yPosition=119
|
|
@ -1,9 +0,0 @@
|
|||||||
#BlueJ class context
|
|
||||||
comment0.target=table
|
|
||||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ table\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
|
||||||
comment1.params=
|
|
||||||
comment1.target=table()
|
|
||||||
comment1.text=\r\n\ Constructor\ for\ objects\ of\ class\ table.\r\n\ \r\n
|
|
||||||
comment2.params=
|
|
||||||
comment2.target=void\ act()
|
|
||||||
numComments=3
|
|
@ -1,18 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int factorial(int n) {
|
|
||||||
int result = 1;
|
|
||||||
for (int i = 1; i <= n; i++) {
|
|
||||||
result *= i;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
int n;
|
|
||||||
printf("请输入一个非负整数:");
|
|
||||||
scanf("%d", &n);
|
|
||||||
printf("%d! = %d\n", n, factorial(n));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
|||||||
#Greenfoot project file
|
|
||||||
class.card.image=blueflip.png
|
|
||||||
class.table.image=porkboard.jpg
|
|
||||||
dependency1.from=table
|
|
||||||
dependency1.to=card
|
|
||||||
dependency1.type=UsesDependency
|
|
||||||
editor.fx.0.height=0
|
|
||||||
editor.fx.0.width=0
|
|
||||||
editor.fx.0.x=0
|
|
||||||
editor.fx.0.y=0
|
|
||||||
height=584
|
|
||||||
package.numDependencies=1
|
|
||||||
package.numTargets=2
|
|
||||||
project.charset=UTF-8
|
|
||||||
publish.hasSource=false
|
|
||||||
publish.locked=true
|
|
||||||
publish.longDesc=
|
|
||||||
publish.shortDesc=
|
|
||||||
publish.tags=
|
|
||||||
publish.title=
|
|
||||||
publish.url=
|
|
||||||
readme.height=60
|
|
||||||
readme.name=@README
|
|
||||||
readme.width=49
|
|
||||||
readme.x=10
|
|
||||||
readme.y=10
|
|
||||||
simulation.speed=50
|
|
||||||
target1.height=70
|
|
||||||
target1.name=card
|
|
||||||
target1.showInterface=false
|
|
||||||
target1.type=ClassTarget
|
|
||||||
target1.width=120
|
|
||||||
target1.x=0
|
|
||||||
target1.y=0
|
|
||||||
target2.height=70
|
|
||||||
target2.name=table
|
|
||||||
target2.showInterface=false
|
|
||||||
target2.type=ClassTarget
|
|
||||||
target2.width=120
|
|
||||||
target2.x=0
|
|
||||||
target2.y=0
|
|
||||||
version=3.0.0
|
|
||||||
width=828
|
|
||||||
world.lastInstantiated=table
|
|
||||||
xPosition=271
|
|
||||||
yPosition=119
|
|