分类: 算法训练

219 篇文章

2838. 元音字母
// 2838. 元音字母.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<iostream> #include<cstring> #include<cstdio> using namespace std; int main() { //string str; //int …
2837. The total number of teams
// 2837. The total number of teams.cpp : 定义控制台应用程序的入口点。 // //#include "stdafx.h" #include<iostream> using namespace std; int main() { int N, i,x, y,sum=0; cin >> N; for (i …
2788.Cifera
// 2788.Cifera.cpp : ¶¨Òå¿ØÖÆ̨ӦÓóÌÐòµÄÈë¿Úµã¡£ // //#include "stdafx.h" #include<iostream> using namespace std; int main() { double k, l, sum; int count; count = 0; cin …
2342
// 2342.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include<cstdio> using namespace std; int main() { double a, b, c, s, v; printf("Input a b c:\n"); scanf("%lf%lf%lf", &a…
2280.Cupboards
// 2280.Cupboards.cpp : 定义控制台应用程序的入口点。 // //#include "stdafx.h" #include<iostream> using namespace std; int main() { //int s1[200], s2[200]; int n,i,x,a0=0,a1=0,b0=0,b1=0,t…
1002_20181019
// 1002_20181019.cpp : 定义控制台应用程序的入口点。 // //#include "stdafx.h" #include<iostream> #include<cmath> using namespace std; int main() { int N,i,max1=0; double x, y,r=0,max=0…
100人成绩的平均
#include "stdafx.h" #include<cstdio> using namespace std; int main() { int i, sum=0,s[100]; for (i = 0; i < 100; i++) { int k = i + 1; printf("请输入第%d位同学的成绩\n",k); scanf(…
蓝桥杯 历届试题 蚂蚁感冒
问题描述 长100厘米的细长直杆子上有n只蚂蚁。它们的头有的朝左,有的朝右。 每只蚂蚁都只能沿着杆子向前爬,速度是1厘米/秒。 当两只蚂蚁碰面时,它们会同时掉头往相反的方向爬行。 这些蚂蚁中,有1只蚂蚁感冒了。并且在和其它蚂蚁碰面时,会把感冒传染给碰到的蚂蚁。 请你计算,当所有蚂蚁都爬离杆子时,有多少只蚂蚁患上了感冒。 输入格式 第一行输入一个整数…
thumbnail
蓝桥杯 算法提高 9-1九宫格
问题描述 九宫格。输入1-9这9个数字的一种任意排序,构成3*3二维数组。如果每行、每列以及对角线之和都相等,打印1。否则打印0。样例输出与上面的样例输入对应的输出。例: 数据规模和约定  输入1-9这9个数字的一种任意排序。 代码 using namespace std; int main(){ int arr[3][3],sum=0,temp,…