P51 第八题
输入整数a和b,如果能被b整除,就输出算式和商,否则输出算式,整数商和余数。
#include<stdio.h>
#include<stdlib.h>
int main()
{int a,b,c;printf("请输入a,b\n");scanf("%d",&a);scanf("%d",&b);if(a%b==0){c = a/b;printf("%d/%d = %d\n",a,b,c);}else{c = a/b;printf("%d/%d = %d...%d\n",a,b,c,a%b);}return 0;
}