![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
基础 笔试
文章平均质量分 51
董道不渝
余将董道而不豫兮
展开
-
360:挑选镇长
#include #include using namespace std;int main(){ int T, n, m, a, b, i, j, cnt; vector v[100001]; vector res; cin>>T; while(T--) { res.clear(); for(i = 0;原创 2015-08-13 15:07:49 · 933 阅读 · 0 评论 -
分解质因数
#include #include #include using namespace std;bool isPrime(int n){ for(int i = 2; i <= (int)sqrt(n); i++) { if(n % i == 0) return false; } return true;}i原创 2015-11-07 12:43:40 · 361 阅读 · 0 评论 -
求平方根
#include #include #include #define E 1e-11using namespace std;int main(){ double a; cin>>a; double x0, x1; x0 = a / 2.0; while(1) { x1 = 0.5 * (a + x0 * x0) /原创 2015-11-06 15:27:10 · 447 阅读 · 0 评论 -
迅雷2016研发工程师笔试题
以下关于指针的说法,正确的是()A int *const p与int const *p等价B const int *p与int *const p等价C const int *p与int const *p等价D int *p[10]与int (*p)[10]等价答案:C解析:A项前者表明指针变量p是const原创 2015-11-28 16:50:24 · 991 阅读 · 0 评论 -
字节对齐(struct 和 union)
在没有#pragma pack宏的情况下,字节对齐应遵循以下三个基本原则:1、数据成员对齐规则:结构体(struct)或联合(union)的数据成员,第一个数据成员放在offset为0的地方,以后每个数据成员存储的起始位置要从该成员大小的整数倍开始。2、结构体作为成员:如果一个结构里有某些结构体成员,则结构体成员要从其内部最大元素大小的整数倍地址开始存储。3、收尾工作:结构原创 2015-11-29 12:44:36 · 838 阅读 · 0 评论