求:CY语言:长整数(至少100位以上)的四则运算。(四则运算只选须完成一个)

来源:百度知道 编辑:UC知道 时间:2024/06/28 23:51:31
我刚刚开始学习C,希望大家帮帮小弟这忙

........怎么这么复杂,这样对新手没有任何帮助的,新手需要简单明了的程序做指引才对.我编了个适用于四则运算的程序,随机出题,可根据要求来练习.
#include <stdlib.h>
#include <stdio.h>
#include "time.h"
#include "conio.h"
long sum,tt,pmax;
int rnd0(long x1,long x2) /*随机出题*/
{ int r;static int n=1;
r=random(4);
switch(r)
{ case 0:printf("%d)%d+%d=",n++,x1,x2);break;
case 1:printf("%d)%d-%d=",n++,x1,x2);break;
case 2:printf("%d)%d×%d=",n++,x1,x2);break;
case 3:printf("%d)%d÷%d=",n++,x1,x2);break;
}
return r;
}
long rnd1() /*取第一个数*/
{ long r;
r=random(pmax);
return r;
}
long rnd2() /*取第二个数*/
{ long r;
r=random(pmax-1)+1;
return r;
}
long crut(long x1,int fh,long x2) /*运算出正确答案*/
{ long asn;
switch(fh)
{ case 0: asn=x1+x2;break;
case 1: asn=x1-x2;break;
case 2: asn=x1*x2;break;
case 3: asn=x1/x