摘要: #include<iostream> #include<algorithm>//sort头文件 using namespace std; struct student{ int theta;//阈值 int result;//结果 }; bool compare(student a,student 阅读全文
posted @ 2021-04-10 12:20 liyou555 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 题目背景 考虑到安全指数是一个较大范围内的整数、小菜很可能搞不清楚自己是否真的安全,顿顿决定设置一个阈值 θ,以便将安全指数 y 转化为一个具体的预测结果——“会挂科”或“不会挂科”。 因为安全指数越高表明小菜同学挂科的可能性越低,所以当 y≥θ 时,顿顿会预测小菜这学期很安全、不会挂科;反之若 y 阅读全文
posted @ 2021-04-10 12:11 liyou555 阅读(239) 评论(0) 推荐(0) 编辑
摘要: std::ios::sync_with_stdio(false)或使用scanf/printf 这个函数是一个“是否兼容 stdio”的开关,C++ 为了兼容 C,保证程序在使用了 printf 和 std::cout 的时候不发生混乱,将输出流绑到了一起。 我们可以在进行 IO 操作之前将 std 阅读全文
posted @ 2021-04-10 09:48 liyou555 阅读(259) 评论(0) 推荐(0) 编辑