![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C
IAMBEEF
这个作者很懒,什么都没留下…
展开
-
习题4-7 最大公约数和最小公倍数 (15分)
#include <stdio.h>void findGcdAndLcm() { int M, N, Gcd; scanf("%d %d", &M, &N); Gcd = findGcd(M, N); printf("%d ", Gcd); printf("%d", findLcm(M, N, Gcd));}//gcd(x, y) = gcd(y, x % y) //prove//x = qy + r(r = x % y)//n | y, n | r,原创 2020-06-23 20:23:20 · 241 阅读 · 0 评论 -
"error: ‘Q’ is a pointer; did you mean to use ‘->’?"
这句话的意思就是访问结构体成员写错了,举例:struct Node { ElementType X;};//对于直接传入结构体,使用'.'去访问void fn(struct Node n){ ElementType X = n.X;}//对于传入结构体指针,使用'->'去访问void fn(struct Node *n){ ElementType X = n->...原创 2019-12-30 20:16:26 · 9256 阅读 · 0 评论