摘要: 字符串比较,3种结果:AC,PE,WA;为了好处理中间的数据让所有输入的字符串连起来并且让两种输入的行数相同,(除却空行) 一个输入函数,一个处理函数 附代码 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using 阅读全文
posted @ 2016-01-27 22:17 闪耀子 阅读(227) 评论(0) 推荐(0)
摘要: 题目不难,逆时针的时候注意,wa了好多次wa的代码,错误 1 #include 2 #include 3 using namespace std; 4 struct Point{ 5 int x;int y; 6 }p[3]; 7 int main() 8 { 9 char c[... 阅读全文
posted @ 2016-01-27 14:05 闪耀子 阅读(136) 评论(0) 推荐(0)
摘要: 选择人们最满意的几个设计元素输出要从大到小输出 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 typedef struct Point{ 8 double score; 9 in... 阅读全文
posted @ 2016-01-27 13:47 闪耀子 阅读(222) 评论(0) 推荐(0)
摘要: 找出现次数最多的数因为n是个奇数,所求的数个数至少出现(n+1)/2次,每次去掉两个不一样的最后剩下的那个数一定是正确答案。。。其实还可以用其他解法,因为除了所求的数字,其他的数字出现次数小于(n+1)/2,因此输出唯一的次数大于(n+1)/2的数就ac了(很简单吧=.=) 1 #include ... 阅读全文
posted @ 2016-01-27 13:44 闪耀子 阅读(119) 评论(0) 推荐(0)
摘要: 火车进出站做了好长时间,用数组类型存储的,没做出来,之后用栈操作,很快就搞定了。 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 int main(){ 9 int n;int a[... 阅读全文
posted @ 2016-01-27 13:33 闪耀子 阅读(135) 评论(0) 推荐(0)
摘要: 数学问题,没难度附代码 1 #include 2 #include 3 4 using namespace std; 5 6 int main() 7 { 8 int N; 9 scanf("%d",&N);10 while(N--){11 int n... 阅读全文
posted @ 2016-01-27 13:30 闪耀子 阅读(153) 评论(0) 推荐(0)
摘要: 破解密码把字符串从大到小排序,5个循环,验证目标函数a-b*b+c*c*c-d*d*d*d+e*e*e*e*e == m为真时得到字符串 结束循环 输出 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6... 阅读全文
posted @ 2016-01-27 13:29 闪耀子 阅读(170) 评论(0) 推荐(0)
摘要: 大数相加附代码 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 int T,flag=0; 9 scanf("%d",&T);10 for(int i=1;ile... 阅读全文
posted @ 2016-01-27 13:22 闪耀子 阅读(153) 评论(0) 推荐(0)
摘要: 选择最便宜的牛奶品牌;牛奶容量最多能喝5天,1天喝200ML,总共为1000ML。牛奶能喝的天数是整数=(int)容量/200。忽略容量小于200ML的牛奶。单价相同的情况下选择容量大的。附代码 1 #include 2 #include 3 #include 4 using namespac... 阅读全文
posted @ 2016-01-27 13:19 闪耀子 阅读(192) 评论(0) 推荐(0)