#include<iostream>
using namespace std;
int test01(int h, int r)
{
float sum = 20 * 1000;
float pi = 3.14;
float buttle = pi * r * r * h;
int N = sum / buttle;
if (sum / buttle != 0)
{
N++;
}
return N;
}
int main()
{
int h;
int r;
cin >> h >> r;
int num = test01(h,r);
cout << num << endl;
system("pause");
return 0;
}
#include<iostream>
using namespace std;
void myJisuan(int a,int b,int c,int d)
{
int start = a * 60 + b;
int end = c * 60 + d;
int sum = end - start;
int hour = sum / 60;
int minus = sum % 60;
cout << hour << " " << minus << endl;
}
int main()
{
int a, b, c, d;
cin >> a >> b >> c >> d;
myJisuan(a, b, c, d);
system("pause");
return 0;
}
#include<iostream>
using namespace std;
int myJisuan(int a,int b)
{
int pen = 19;
int sum = a * 10 + b;
int N = sum / pen;
return N;
}
int main()
{
int a, b;
cin >> a >> b;
int number = myJisuan(a, b);
cout << number << endl;
system("pause");
return 0;
}
#include<iostream>
using namespace std;
int myCalculate(int a, int b, int c)
{
float A = a * 0.2;
float B = b * 0.3;
float C = c * 0.5;
int sum = A + B + C;
return sum;
}
int main()
{
int a, b, c;
cin >> a >> b >> c;
int score=myCalculate(a, b, c);
cout << score << endl;
system("pause");
return 0;
}
# 【深基1-2】小学数学 N 合一
## 题目描述
### 问题 1
请输出 `I love Luogu!`
### 问题 2
这里有 $10$ 个苹果,小 A 拿走了 $2$ 个,Uim 拿走了 $4$ 个,八尾勇拿走剩下的所有的苹果。我们想知道:
1. 小A 和 Uim 两个人一共拿走多少苹果?
2. 八尾勇能拿走多少苹果?
现在需要编写一个程序,输出两个数字作为答案,中间使用空格分开。
### 问题 3
现在有 $14$ 个苹果。要均分给 $4$ 名同学,分不掉的苹果放回冰箱。请问:
1. 每位同学能分得几个苹果?
2. 一共分出去多少苹果?
3. 把几个苹果放回冰箱?
现在需要编写一个程序,输出三个数字作为答案,每个数字一行。
### 问题 4
现在有 $500$ 毫升的肥宅快乐水,要均分给 $3$ 名同学,每位同学可以分到多少毫升?请输出一个数字作为输出。保留 $6$ 位有效数字,且不使用科学计数法。
### 问题 5
甲列火车长 $260$ 米,每秒行 $12$ 米;乙列火车长 $220$ 米,每秒行 $20$ 米,两车相向而行,从两车车头相遇时开始计时,多长时间后两车车尾相离?已知答案是整数。
### 问题 6
一个长方形长宽分别是 $6 \text{ cm}$、$9 \text{ cm}$,求它的对角线长度($\text{cm}$)。直接使用 `cout` 输出。
### 问题 7
Uim 银行账户里面有 $100$ 元。经过了下面的操作:
1. 往里面存了 $10$ 元;
2. 购物花掉了 $20$ 元;
3. 把里面的钱全部取出。
请在每次操作后输出账户余额,并使用换行符隔开。
### 问题 8
当半径为 $r=5$,请输出圆的周长、面积和球体积。取 $\pi=3.141593$。请直接使用 `cout` 输出答案,每行一个数字。
### 问题 9
一只小猴买了若干个桃子。第一天他刚好吃了这些桃子的一半,又贪嘴多吃了一个;第二天他也刚好吃了剩余桃子的一半,贪嘴多吃了一个;第三天他又刚好吃了剩下的桃子的一半,并贪嘴多吃了一个。第四天起来一看,发现桃子只剩下一个了。请问小猴买了几个桃子?
### 问题 10
洛谷的评测任务是单位时间内均匀增加的。$8$ 台评测机 $30$ 分钟可以刚好把评测队列中的程序评测完毕,$10$ 台评测机 $6$ 分钟可以刚好把评测队列中的程序评测完毕,请问几台评测机可以在 $10$ 分钟时刚好把评测队列中的程序评测完毕?
### 问题 11
小 A 跑步速度 $5 \text{ m/s}$,八尾勇跑步速度 $8 \text{ m/s}$,八尾勇在小 A 后面 $100 \text{ m}$,他们同时起跑,请问需要多长时间八尾勇可以追上小 A?输出一个数字表示答案,使用 `cout` 直接输出。
### 问题 12
大家都知道有 $26$ 个英文字母,其中 A 是第一个字母。现在请编程求出:
1. M 是字母表中的第几个字母?
2. 第 $18$ 个字母是什么?
输出一个数字和一个字母,使用换行隔开。
### 问题 13
小 A 有两块球形橡皮泥,一个半径是 $4$,一个半径是 $10$。他想把这两块橡皮泥揉在一起,然后塑造成一个正方体,请问这个正方体的棱长是多少?如果结果不是整数,则舍去小数点之后的数字。取 $\pi = 3.141593$。
### 问题 14
根据咕咕网校的预测,当课程定价为 $110$ 元时,会有 $10$ 人报名。如果课程价格每降低 $1$ 元,就会多 $1$ 名报名者(反之亦然)。如果希望总共能收到 $3500$ 元学费的话,那么应该定价多少呢?已知本题有两个答案符合要求,则取较小的那一个。如果这个答案不是整数,则需四舍五入精确到整数。
#include<iostream>
using namespace std;
#include<iomanip>
#include<cmath>
void myQuestion(int a)
{
if (a == 1)
{
cout << "I love Luogu!" << endl;
}
else if (a == 2)
{
cout << 2 + 4 << " " << 10 - 2 - 4 << endl;
}
else if (a == 3)
{
cout << 14 / 4 << endl;
cout << 14 / 4 * 4 << endl;
cout << 14 % 4 << endl;
}
else if (a == 4)
{
cout << fixed << setprecision(3) <<1.0* 500 / 3 << endl;
}
else if (a == 5)
{
cout << (260 + 220) / (12 + 20) << endl;
}
else if (a == 6)
{
cout << sqrt(6*6+9 * 9) << endl;
}
else if (a == 7)
{
cout << 100 + 10 << endl;
cout << 100 + 10 - 20 << endl;
cout << 0 << endl;
}
else if (a == 8)
{
const double pi = 3.141593;
cout << pi * 10 << endl << pi * 25 << endl << 4 / 3 * pi * 125 << endl;
}
else if (a == 9)
{
cout << (((1 + 1) * 2 + 1) * 2 + 1) * 2 << endl;
}
else if (a == 10)
{
cout << 9 << endl;
}
else if (a == 11)
{
cout << 100 / (8 - 5)+1 << endl;
}
else if (a == 12)
{
char ch1, ch2;
ch1 = 'A';
ch2 = 'M';
int a = ch2 - ch1 + 1;
cout << a << endl;
int b = 18;
char ch3 = ch1 + b - 1;
cout << ch3 << endl;
}
else if (a == 13)
{
double d = (4.0/ 3) * 3.141593 * 4 * 4 * 4 + (4.0 / 3) * 3.141593 * 10 * 10 * 10;
double b = pow(d, 1.0 / 3);
int c = b;
cout <<c << endl;
}
else if (a == 14)
{
cout << 50 << endl;
}
}
int main()
{
int a;
cin >> a;
myQuestion(a);
system("pause");
return 0;
}
#include<iostream>
using namespace std;
void myCalculate(int m, int t, int s)
{
if (t == 0)
{
cout << 0 << endl;
}
else
{
int number = s / t;
if (s % t != 0)
{
number++;
}
if (number > m)
{
cout << 0 << endl;
}
else
{
cout << m - number << endl;
}
}
}
int main()
{
int m, t, s;
cin >> m >> t >> s;
myCalculate(m, t, s);
system("pause");
return 0;
}
#include<iostream>
using namespace std;
void xiaoaLike(int number)
{
if (number % 2 == 0)
{
if (number > 4 && number <= 12)
{
cout << 1 << " ";
}
else
{
cout << 0 << " ";
}
}
else
{
cout << 0 << " ";
}
}
void uimLike(int number)
{
if((number%2==0)||(number>4&&number<=12))
{
cout << 1 << " ";
}
else
{
cout << 0 << " ";
}
}
void baweiyongLike(int number)
{
if (number % 2 == 0)
{
if (number > 4 && number <= 12)
{
cout << 0 << " ";
}
else
{
cout << 1 << " ";
}
}
else
{
if (number > 4 && number <= 12)
{
cout << 1 << " ";
}
else
{
cout << 0 << " ";
}
}
}
void zhenmeiLike(int number)
{
if (number % 2 == 0)
{
if (number > 4 && number <= 12)
{
cout << 0 ;
}
else
{
cout << 1 ;
}
}
else
{
cout <<1 ;
}
}
int main()
{
int number;
cin >> number;
xiaoaLike(number);
uimLike(number);
baweiyongLike(number);
zhenmeiLike(number);
system("pause");
return 0;
}