c语言为什么输出总是出错?

#include
#include
#define INF 1000000000
int main() {
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
int x = 0; int count = 0; int a, b, c;
while (scanf("%d", &x) == 1) {
if (count == 0) {
a = x;
printf("%d ", &a);
}
if (count == 1) {
b = x;
printf("%d ", &a);
}
if (count == 2) {
c = x;
printf("%d ", &c);
}
count++;
}
printf("%d %d %d", &a, &b, &c);
fclose(stdin);
fclose(stdout);

}

如上 输出为7927668 7927668 7927668 (in.txt中为 1 2 6)

但是 如下却可一成功输出 1 2 6
#include
#include
#define INF 1000000000
int main() {
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
int x = 0; int count = 0; int a, b, c;
while (scanf("%d", &x) == 1) {
if (count == 0) {
a = x;
}
if (count == 1) {
b = x;
}
if (count == 2) {
c = x;
}
count++;
printf("%d", x);

}

fclose(stdin);
fclose(stdout);

}

具体的错误内容是什么

printf("%d %d %d", &a, &b, &c);
这里应该改为:
printf("%d %d %d", a, b, c);

输出不需要&
加了&表示变量的地址

printf("%d %d %d", &a, &b, &c);输出的是变量的地址不是变量的值

printf("%d %d %d", &a, &b, &c);输出的是变量的地址不是变量的值

http://blog.csdn.net/a29562268/article/details/56331674 参考printf内部实现

输出不需要&,直接写变量名即可,&表示变量的地址

printf不需要提供对象(变量)的指针。所以只要把&去掉就可以了。
scanf修改的是外部变量的值。应提供指针。这是因为C语言没有引用这种类型。
把&去掉就可以了。

printf直接输出变量的

建议题主以后代码注意下格式啊,看起来好难受