洛谷官方题单100代码展示,如有问题或者是我的代码有问题,欢迎提问与指正
#include<iostream>
#include<cmath>
#define pai 3.141593
using namespace std;
//typedef unsignd long long ll;
/*p1001
int main()
{
int a, b;
while (cin >> a >> b)
{
int sum = 0;
sum = a + b;
cout << sum << endl;
}
return 0;
}*/
/*p1000
int main()
{
cout << " ********" << endl;
cout << " ************" << endl;
cout << " ####....#." << endl;
cout << " #..###.....##...." << endl;
cout << " ###.......###### ### ###" << endl;
cout << " ........... #...# #...#" << endl;
cout << " ##*####### #.#.# #.#.#" << endl;
cout << " ####*******###### #.#.# #.#.#" << endl;
cout << " ...#***.****.*###.... #...# #...#" << endl;
cout << " ....**********##..... ### ###" << endl;
cout << " ....**** *****...." << endl;
cout << " #### ####" << endl;
cout << " ###### ######" << endl;
cout << "##############################################################" << endl;
cout << "#...#......#.##...#......#.##...#......#.##------------------#" << endl;
cout << "###########################################------------------#" << endl;
cout << "#..#....#....##..#....#....##..#....#....#####################" << endl;
cout << "########################################## #----------#" << endl;
cout << "#.....#......##.....#......##.....#......# #----------#" << endl;
cout << "########################################## #----------#" << endl;
cout << "#.#..#....#..##.#..#....#..##.#..#....#..# #----------#" << endl;
cout << "########################################## ############" << endl;
return 0;
}*/
/*p5703
int main()
{
int m, n;
while (cin >> m >> n)
{
int sum = m * n;
cout << sum << endl;
sum = 0;
}
return 0;
}*/
/*p5704
int main()
{
char a, b;
while (cin >> a)
{
b = a - 32;
cout << b << endl;
}
return 0;
}*/
/*p5705
int main()
{
double m;
int a, b, c, d;
while (cin >> m)
{
a = (int)m / 100;
b = ((int)m / 10) % 10;
c = (int)m % 10;
d = (int)(m * 10) % 10;
cout << d << "." << c << b << a << endl;
}
}*/
/*p5706
int main()
{
double t,t1;
int n,n1;
while (cin >> t >> n)
{
t1 = t / n;
n1 = 2 * n;
printf("%.3f\n", t1);
cout << n1 << endl;
}
}*/
/*p1425
int main()
{
int a, b, c, d;
int time1, time2;
while (cin >> a >> b >> c >> d)
{
time1 = a * 60 + b;
time2 = c * 60 + d;
int time = time2 - time1;
int e = time/60;
int f = time % 60;
cout << e << " " << f;
}
}*/
/*p2433
int main()
{
int n;
while (cin >> n)
{
switch (n)
{
case 1:
{
cout << "I love Luogu!" << endl;
break;
}
case 2:
{
cout << "6 4" << endl;
break;
}
case 3:
{
cout << "3" << endl << "12" << endl << "2" << endl;
break;
}
case 4:
{
double a = (double)500 / 3;
printf("%.3f\n", a);
break;
}
case 5:
{
cout << "15" << endl;
break;
}
case 6:
{
double ca = sqrt(6 * 6 + 9 * 9);
cout << ca << endl;
break;
}
case 7:
{
cout << "110" << endl << "90" << endl << "0" << endl;
break;
}
case 8:
{
cout << 2 * 5 * pai << endl << pai * 5 * 5 << endl << (double)4 / 3 * pai * 5 * 5 * 5 << endl;
break;
}
case 9:
{
cout << "22" << endl;
break;
}
case 10:
{
cout << "9" << endl;
break;
}
case 11:
{
cout << (double)100 / 3 << endl;
break;
}
case 12:
{
cout << "13" << endl << "R" << endl;
break;
}
case 13:
{
double v1 = (double)4 / 3 * pai * 4 * 4 * 4;
double v2 = (double)4 / 3 * pai * 10 * 10 * 10;
double v = v1 + v2;
int s = pow((int)v, 1.0 / 3);
cout << s << endl;
break;
}
case 14:
{
int jg = 110, bm = 10;
int jgb;
int min = 0;
for (int i = 110; i > 0 ; i--)
{
int zj = i * bm;
if (zj >= 3500)
{
jgb = i;
}
bm++;
}
cout << jgb << endl;
break;
}
default:break;
}
}
return 0;
}*/
/*p5708
int main()
{
double a, b, c, p, s;
while (cin >> a >> b >> c )
{
p = (double)1 / 2 * (a + b + c);
s = sqrt(p * (p - a) * (p - b) * (p - c));
printf("%.1f\n", s);
}
}*/
/*
int main()
{
int a, b;
while (cin >> a >> b)
{
int sum = a * 10 + b;
int ans = sum / 19;
cout << ans << endl;
}
}*/
/*p5709
int main()
{
int m, t, s;
while (cin >> m >> t >> s)
{
if (t == 0)
cout << "0" << endl;
else if (s >= m * t)
cout << "0" << endl;
else
{
int sum = (double)m - ((double)s / t);
cout << sum << endl;
}
}
}*/
/*p2181
int main()
{
ll n;
while (cin >> n)
{
ll answer;
if (n == 3)
cout << "0" << endl;
else if (n == 4)
cout << "1" << endl;
else if(n>4)
{
answer = n*(n-1)/2*(n-2)/3*(n-3)/4;
cout << answer << endl;
}
}
}*/
/*p5707
int main()
{
int s, v;
int s1, v1;
while (cin >> s >> v)
{
double t = (double)s / v;
if (t <= 470)//470是7:50化为分钟,如果t小于等于470,说明在同一天
{
s1 = (int)(470 - t) / 60;
v1 = (int)(470 - t) % 60;
}
else if (t > 470)
{
s1 = (int)((470 + 24 * 60) - t) / 60;
v1 = (int)((470 + 24 * 60) - t) % 60;
}
if (s1 < 10)
cout << "0" << s1 << ":";
else if (s1 >= 10)
cout << s1 << ":";
if (v1 < 10)
cout << "0" << v1 << endl;
else if (v1 >= 10)
cout << v1 << endl;
}
}*/
/*p3954
int main()
{
int A, B, C;
double a, b, c;
int sum;
while (cin >> A >> B >> C)
{
a = (double)A * 0.2;
b = (double)B * 0.3;
c = (double)C * 0.5;
sum = (double)(a + b + c);
cout << sum << endl;
}
}*/
本文档展示了洛谷官方题单中的多个编程练习,涉及整数加减、字符转换、数学运算、字符串输出、条件判断、循环结构等,适合学习者练习和提高编程技能。
2680

被折叠的 条评论
为什么被折叠?



