2013年6月17日

《算法竞赛入门经典》第三章上机练习(1)

摘要: 练习3-1 分数统计 输入一些学生的分数,哪个分数出现的次数最多?如果有多个并列,从小到大输出。 任务1:分数均为不超过100的非负整数。 任务2:分数均为不超过100的非负实数,但最多保留两位小数。---------------------------------------------------------------1//任务12#include<stdio.h>3#include<string.h>4inta[101];56intmain()7{8inti,b,temp,max=0;9memset(a,0,sizeof(a));1011while(scanf( 阅读全文

posted @ 2013-06-17 17:57 飞天小鹭 阅读(271) 评论(0) 推荐(0) 编辑

《算法竞赛入门经典》第三章习题 (2)

摘要: 为啥所有的输入输出用的时间都是零额1#defineLOCAL2#include<stdio.h>3#include<fstream>4#include<time.h>5usingnamespacestd;6#defineMAXN100107chars[MAXN];89intmain()10{11FILE*fin;12fin=fopen("data.txt","r");1314#ifdefLOCAL15freopen("dataout.txt","w",stdout);16#end 阅读全文

posted @ 2013-06-17 10:14 飞天小鹭 阅读(149) 评论(0) 推荐(0) 编辑

导航