[求助]有关输出格式的问题。
若a=3,b=4,c=5,要想得到下面的输出格式和结果,请写出程序。a=$3$$b=$4$$c=$5(其中'$'代表空格)
main()
{
int a,b,c;
printf("\n");
printf("a=%2db=%2dc=%2d\n",a,b,c);
}
这个程序对吗?为什么?
2006-11-11 16:47
你的a,b,c,没有初始化。
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a = 3,b = 4,c = 5;
printf("\n");
printf("a=%2d b=%2d c=%2d\n",a,b,c);
return 0;
}

2006-11-11 18:06
2006-11-11 18:30
2006-11-11 18:33
如果main()前面没有加 void,一定要在程序中写 return 0;吗?
意思是不是告诉计算机main()返回值0,什么也不做啊?
2006-11-11 22:01
2006-11-11 22:22