本帖最后由 chenbb7 于 2013-9-25 14:51 编辑
牡丹花下死做鬼 发表于 2013-9-20 20:12
sorry 刚刚不在 O(∩_∩)O
我也研究了下,很费脑筋#include <stdio.h>
int a,b,c,d;
char ch;
void input()//输入函数
{
scanf("%d %d",&a, &b);
while (a < b)
{
printf(" please enter two ingeters,such as 1 > 2\n");
setbuf(stdin, NULL);//清空标注输入流的缓冲区
scanf("%d %d",&a, &b);
};
}
void count()//运算函数
{
c=a/b;
d=a%b;
printf("二者的商为%d,余数为%d\n",c,d);
}
void main()
{
do
{
printf("enter two ingeters (Please enter the end of e) :\n");
input();
if((ch= getchar()) != 'e')
{
count();
}
else
{
break;
}
}while(1);
system("pause");
}
|