'commit'
This commit is contained in:
10
TangDou/LanQiaoBei/LanQiao12XuanBaSai/1.cpp
Normal file
10
TangDou/LanQiaoBei/LanQiao12XuanBaSai/1.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int a, b;
|
||||
cin >> a >> b;
|
||||
printf("%d", a * b);
|
||||
return 0;
|
||||
}
|
||||
12
TangDou/LanQiaoBei/LanQiao12XuanBaSai/2.cpp
Normal file
12
TangDou/LanQiaoBei/LanQiao12XuanBaSai/2.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
cin >> n;
|
||||
if (n <= 20) printf("%d", n * 10);
|
||||
else
|
||||
printf("%d", 20 * 10 + (n - 20) * 15);
|
||||
return 0;
|
||||
}
|
||||
23
TangDou/LanQiaoBei/LanQiao12XuanBaSai/3.cpp
Normal file
23
TangDou/LanQiaoBei/LanQiao12XuanBaSai/3.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
//判断一个数是不是质数
|
||||
bool isPrime(int n) {
|
||||
if (n < 2) return false;
|
||||
for (int i = 2; i <= n / i; i++)
|
||||
if (n % i == 0) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
int ans;
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
cin >> n;
|
||||
for (int i = 7; i <= n; i++)
|
||||
if (i % 10 == 7 && isPrime(i)) ans++;
|
||||
|
||||
cout << ans << endl;
|
||||
return 0;
|
||||
}
|
||||
66
TangDou/LanQiaoBei/LanQiao12XuanBaSai/4.cpp
Normal file
66
TangDou/LanQiaoBei/LanQiao12XuanBaSai/4.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
//24点
|
||||
int main() {
|
||||
int a, b, c, d;
|
||||
cin >> a >> b >> c >> d;
|
||||
int res = 0, x;
|
||||
x = a + b + c + d;
|
||||
if (x == 24) res++;
|
||||
x = a + b + c - d;
|
||||
if (x == 24) res++;
|
||||
x = a + b + c * d;
|
||||
if (x == 24) res++;
|
||||
x = a + b - c + d;
|
||||
if (x == 24) res++;
|
||||
x = a + b - c - d;
|
||||
if (x == 24) res++;
|
||||
x = a + b - c * d;
|
||||
if (x == 24) res++;
|
||||
x = a + b * c + d;
|
||||
if (x == 24) res++;
|
||||
x = a + b * c - d;
|
||||
if (x == 24) res++;
|
||||
x = a + b * c * d;
|
||||
if (x == 24) res++;
|
||||
x = a - b + c + d;
|
||||
if (x == 24) res++;
|
||||
x = a - b + c - d;
|
||||
if (x == 24) res++;
|
||||
x = a - b + c * d;
|
||||
if (x == 24) res++;
|
||||
x = a - b - c + d;
|
||||
if (x == 24) res++;
|
||||
x = a - b - c - d;
|
||||
if (x == 24) res++;
|
||||
x = a - b - c * d;
|
||||
if (x == 24) res++;
|
||||
x = a - b * c + d;
|
||||
if (x == 24) res++;
|
||||
x = a - b * c - d;
|
||||
if (x == 24) res++;
|
||||
x = a - b * c * d;
|
||||
if (x == 24) res++;
|
||||
x = a * b + c + d;
|
||||
if (x == 24) res++;
|
||||
x = a * b + c - d;
|
||||
if (x == 24) res++;
|
||||
x = a * b + c * d;
|
||||
if (x == 24) res++;
|
||||
x = a * b - c + d;
|
||||
if (x == 24) res++;
|
||||
x = a * b - c - d;
|
||||
if (x == 24) res++;
|
||||
x = a * b - c * d;
|
||||
if (x == 24) res++;
|
||||
x = a * b * c + d;
|
||||
if (x == 24) res++;
|
||||
x = a * b * c - d;
|
||||
if (x == 24) res++;
|
||||
x = a * b * c * d;
|
||||
if (x == 24) res++;
|
||||
cout << res;
|
||||
return 0;
|
||||
}
|
||||
39
TangDou/LanQiaoBei/LanQiao12XuanBaSai/newyear.cpp
Normal file
39
TangDou/LanQiaoBei/LanQiao12XuanBaSai/newyear.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
int days, y1, y2, m1, m2, d1, d2;
|
||||
const int N = 13;
|
||||
int months_1[N] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
int months_2[N] = {0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
|
||||
bool LeapYear(int year) {
|
||||
return ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);
|
||||
}
|
||||
|
||||
int main() {
|
||||
cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2;
|
||||
//2000.2.3--- 2009.8.9
|
||||
// [2001,2002,2003,2004,2005,2006,2007,2008]
|
||||
//y1+1--->y2-1
|
||||
for (int i = y1 + 1; i <= y2 - 1; i++) {
|
||||
if (LeapYear(i))days += 366;
|
||||
else days += 365;
|
||||
}
|
||||
//y2
|
||||
for (int i = 1; i <= m2 - 1; i++)
|
||||
if (LeapYear(y2)) days += months_2[i];
|
||||
else days += months_1[i];
|
||||
days += d2;
|
||||
|
||||
//y1
|
||||
int d0 = 0;
|
||||
for (int i = 1; i <= m1 - 1; i++)
|
||||
if (LeapYear(y1)) d0 += months_2[i];
|
||||
else d0 += months_1[i];
|
||||
d0 += d1 - 1;
|
||||
if (LeapYear(y1))days += 366 - d0;
|
||||
else days += 365 - d0;
|
||||
//输出
|
||||
cout << days - 1 << endl;
|
||||
return 0;
|
||||
}
|
||||
BIN
TangDou/LanQiaoBei/LanQiao12XuanBaSai/题目/0328CC01.jpg
Normal file
BIN
TangDou/LanQiaoBei/LanQiao12XuanBaSai/题目/0328CC01.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
BIN
TangDou/LanQiaoBei/LanQiao12XuanBaSai/题目/0328CC03.jpg
Normal file
BIN
TangDou/LanQiaoBei/LanQiao12XuanBaSai/题目/0328CC03.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 115 KiB |
BIN
TangDou/LanQiaoBei/LanQiao12XuanBaSai/题目/0328CC04.jpg
Normal file
BIN
TangDou/LanQiaoBei/LanQiao12XuanBaSai/题目/0328CC04.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 144 KiB |
BIN
TangDou/LanQiaoBei/LanQiao12XuanBaSai/题目/0328cc02.jpg
Normal file
BIN
TangDou/LanQiaoBei/LanQiao12XuanBaSai/题目/0328cc02.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 95 KiB |
Reference in New Issue
Block a user