加入了文件的名字
This commit is contained in:
parent
07320d68ef
commit
9a87ba69d6
@ -1,3 +1,5 @@
|
||||
//登录系统(普通)
|
||||
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
#include<windows.h>
|
||||
|
@ -1,3 +1,5 @@
|
||||
//登录系统(升级版)
|
||||
|
||||
#include<iostream>
|
||||
#include<string>
|
||||
#include<windows.h>
|
||||
|
@ -1,6 +1,9 @@
|
||||
//猴子吃桃
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
/*
|
||||
int main() {
|
||||
int peaches = 1; // 第10天剩下的桃子数
|
||||
// 逆推从第10天到第1天
|
||||
@ -10,3 +13,15 @@ int main() {
|
||||
cout << "第1天摘的桃子数量是: " << peaches << endl;
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int main(){
|
||||
int x = 1,day = 9;
|
||||
while (day > 0)
|
||||
{
|
||||
x = (x+1) * 2;
|
||||
day--;
|
||||
}
|
||||
cout <<"共摘了"<<x<<"个桃子"<<endl;
|
||||
return 0;
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
//计算阶乘
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
/*
|
||||
int main() {
|
||||
int n;
|
||||
cin >> n; // 输入一个正整数n
|
||||
@ -14,3 +16,18 @@ int main() {
|
||||
cout << result << endl; // 输出阶乘的结果
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int main(){
|
||||
long long sum = 1;
|
||||
int n;
|
||||
cin >>n;
|
||||
int i = 1;
|
||||
while (i <= n)
|
||||
{
|
||||
sum *= i;
|
||||
i++;
|
||||
}
|
||||
cout <<sum<<endl;
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user