摘要: 此题太给其他25分的题丢人了,只值15分 注意要求最终结果最长,而且向下取整 include include using namespace std; float arr[10005]; int main(){ int N;scanf("%d",&N); for(int i=0;i 阅读全文
posted @ 2018-08-18 06:45 路明天 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 水题一道,直接贴代码 include include int main(){ //玩家的筹码数、以及 int T,K;scanf("%d %d",&T,&K); for(int i=0;iT){ //钱不够 printf("Not enough tokens. Total = %d.\n",T); 阅读全文
posted @ 2018-08-17 08:48 路明天 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 代码注释应该很清晰 先存下违禁品,放到数组中,未使用map include include int wupin[10],N,M; bool isin(int A){ //判断是否为违禁品 for(int i=0;i 阅读全文
posted @ 2018-08-17 08:46 路明天 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 此处为我的存储结构,只提供一种思路,二维数组存储所有数据 include include include include include using namespace std; int ti[200][20]={0}; bool ffind(char p,char c){ int len = st 阅读全文
posted @ 2018-08-17 08:45 路明天 阅读(458) 评论(0) 推荐(0) 编辑
摘要: 打一开始做就听人说这个难,吓得我把它放到了最后做,不过如此嘛。 这里说说样例的坑点 1.最后结果可能高位有0;例如样例结果07201 2.结果会进位, 3.有可能结果是0,(此处取决于你的输出方式) 阅读全文
posted @ 2018-08-17 08:44 路明天 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 注意接收字符时缓冲区的换行要接受掉 阅读全文
posted @ 2018-08-17 08:43 路明天 阅读(799) 评论(0) 推荐(1) 编辑
摘要: 这道题算有点难,心目中理想的难度。 不能前怕狼后怕虎,一会担心超时,一会又担心内存过大,直接撸 将三部分分别保存到vector 有意思的在于输出 分别输出第一个的add和num 中间输出nextadd ,换行,add,num 最后输出尾元素的next为 1 include include inclu 阅读全文
posted @ 2018-08-17 08:43 路明天 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 录入成绩,直接将所有同学给的分数相加,排序,减去最大和最小 省去了遍历一次 注意四舍五入 include include include using namespace std; int main(){ //分别是分组数和满分 int N,M;scanf("%d %d",&N,&M); for(in 阅读全文
posted @ 2018-08-17 08:42 路明天 阅读(494) 评论(0) 推荐(0) 编辑
摘要: 主函数接收下第一个字符,接着一个分支就转到两个函数中的一个 1.压缩简单,只要与下一个一样就只计数,如果不同了就直接输出 2.至于解压不知道数字是几位数,所以我直接用了sscanf,然后判断是几位数字,将指针知道后面的内容字符输出 include include include include us 阅读全文
posted @ 2018-08-17 08:40 路明天 阅读(393) 评论(0) 推荐(0) 编辑
摘要: 用了柳婼大佬博客的思路,但实现有不同 没有用string所以要考虑字符串末尾的‘\0’ 用的stl中的reverse逆置字符串 阅读全文
posted @ 2018-08-17 08:39 路明天 阅读(349) 评论(0) 推荐(0) 编辑