A: Idea : 1. Support true score, use the Math function show ()
2.30 operations so use the loop function i+1
3. Ensure that there are no duplicate formulas, so use the For statement.
Two: Program code:#include <stdio.h>
#include <Windows.h>
#include <time.h>
void Main ()
{
int A, B, C, d,i,m,n;
float p, q;
Srand (Unsigned (Time (NULL)));
for (i = 0; i <; i++)
{
A = rand ()% 100;
b = rand ()% 100;
c = rand ()% 5;
Switch (c)
{
Case 0:printf ("%d +%d =\n", A, b);
Break
Case 1:if (A < b)
{
D = A;
A = b;
}
printf ("%d-%d =\n", A, b);
Break
Case 2:printf ("%d *%d =\n", A, b);
Break
Case 3:
while (b = = 0)
{
b = rand ()% 100;
}
printf ("%d/%d =\n", A, b);
Break
Case 4:
A = rand ()% 100;
b = rand ()% 100;
m = rand ()% 100;
n = rand ()% 100;
c = rand ()%4;
while (b = = 0)
{
b = rand ()% 100;
}
while (n = = 0)
{
n = rand ()% 100;
}
if (a > B)
{
D = A;
A = b;
b = D;
}
if (M > N)
{
d = m;
m = n;
n = d;
}
Switch (c)
{
Case 0:printf ("%d/%d +%d/%d =\n", A, B, M, n);
Break
Case 1:
p = (float) A/(float) b;
Q = (float) m/(float) n;
if (P < q)
{
D = A;
A = m;
m = D;
D = b;
b = n;
n = d;
}
printf ("%d/%d-%d/%d =\n", a,b,m,n);
Break
Case 2:printf ("%d/%d *%d/%d =\n", A, B, M, n);
Break
Case 3:
A = rand ()% 100;
b = rand ()% 100;
m = rand ()% 100;
n = rand ()% 100;
c = rand ()% 4;
while (M = = 0)
{
m = rand ()% 100;
}
printf ("%d/%d/%d/%d =\n", A, B, M, n);
Break
}
}
}
System ("pause");
}
Three: Operation result :
Arithmetic to add functionality