【发布时间】:2013-12-09 23:19:09
【问题描述】:
这是我的程序。应该写出一些整数的平方。
#include <stdio.h>
int main (){
int a;
printf("Type an intiger.");
scanf("%i", &a);
printf("Square of that intiger is %i", a*a);
return 0;
}
当我在 Eclipse 中运行一个程序时,它首先要求我输入一个数字。我输入 5。然后作为输出它给我
Type an intiger.Square of that intiger is 25.
它应该首先打印“Type an intiger”,然后再打印其余部分。但它只是结合了两个 printf 命令。问题是什么?
【问题讨论】:
-
应该是“整数”
-
使用我刚刚下载的最新 Eclipse C/C++ 版本,您的代码的复制粘贴就像人们期望的那样工作。也许download it here,然后再试一次。
-
我在这里找到了答案:stackoverflow.com/questions/16877264/… 无论如何谢谢。