请问哪里错了?
#include<stdio.h>main()
{
int a,b,c,d;
printf("Input a&b\n");
scanf("%d%d\n",&a,&b);
c=a/b;
d=a%b;
printf("商是%d\n",c);
printf("余是%d\n",d);
}
编写程序,读入两个整数1500和350,求出它们的商和余数并进行输出。
2012-01-17 11:04
程序代码:#include<stdio.h>
main()
{
int a,b,c,d;
printf("Input a&b\n");
scanf("%d%d\n",&a,&b); 把换行符去掉
c=a/b;
d=a%b;
printf("商是%d\n",c);
printf("余是%d\n",d);
}
它在这里不起换行作用,你输入两个数字,在输入换行符,再打回车就知道了
2012-01-17 11:18
2012-01-17 11:22
2012-01-17 11:25
2012-01-17 11:26
2012-01-17 11:27
2012-01-17 14:08
程序代码:#include<stdio.h>
main()
{
int a,b,c,d;
printf("Input a&b\n");
scanf("%d%d\n",&a,&b); //把换行符去掉
c=a/b;
d=a%b;
printf("\n商是%d\n",c); //换行加在这里
printf("余是%d\n",d);

2012-01-17 15:43
2012-01-18 17:30