2012年11月6日
摘要: 此题就是一道令人无法琢磨的题!哎!!我简直就无语了!!呵呵!竟然能出这题。。。。废话少说,直接ac!!!*** 此题要想输出结果,还需要注意一下!在linux下,EOF好像是就是ctrl+d在windows下是敲一下ctrl+z,然后按一下换行即enter,然后再按一下ctrl+z,最后敲enter即得结果!***#include<iostream>using namespace std;int main(){char a[100];double b,c,sum; sum=0;while(scanf("%s",a)!=EOF){ cin>>b> 阅读全文
posted @ 2012-11-06 21:22 @ 小浩 阅读(272) 评论(0) 推荐(0)
摘要: 此题仍然是一道典型贪心问题,先将javabean和猫食的比例算出来,然后将他们排序,最后再依次求出最佳值即可!!呵呵!也没有太多好说的,关于函数sort()的讲解请参考:http://www.cnblogs.com/xiohao/archive/2012/11/05/2755183.htmlac吧!!!呵呵!!!#include<iostream>#include<algorithm>using namespace std;struct sa{double a1;double a2;double m;}a[1001];bool cmp(const sa &a,c 阅读全文
posted @ 2012-11-06 12:02 @ 小浩 阅读(412) 评论(0) 推荐(0)
摘要: 此题是一道典型的贪心问题呵呵!!!首先将输入的数据对结束时间进行排序,然后开始依次统计即可!!!呵呵!关于sort()函数的讲解请参考:http://www.cnblogs.com/xiohao/archive/2012/11/05/2755183.html剩下的也就没有什么好说的了哈!!!ac吧!!#include<iostream>#include<algorithm>using namespace std; struct TV{int start;int end;} date[101]; bool cmp(const TV &a,const TV & 阅读全文
posted @ 2012-11-06 11:12 @ 小浩 阅读(256) 评论(0) 推荐(0)