c语言问题
#include <stdio.h>int main(void)
{
int cows,legs;
printf("How many cow legs did you count?\n");
scanf("%d",&legs);
cows = legs / 4;
printf("That implies there are %d cows.\n, cows");
return 0;
}
对于这个程序,比如说我输入了数字8,但是得出来的结果却是11。这是怎么回事。 本帖最后由 jackz007 于 2020-11-25 18:20 编辑
引号写错了位置
printf("That implies there are %d cows.\n, cows");
改成下面这样
printf("That implies there are %d cows.\n", cows); jackz007 发表于 2020-11-25 18:17
引号写错了位置
printf("That implies there are %d cows.\n, cows");
改成下面 ...
对
页:
[1]