Software for two pillars
Arithmetic to support true scores
Can define the number of quiz
#define _crt_secure_no_deprecate
#include <stdio.h>
#include <Windows.h>
#include <time.h>
int main ()
{
int A, B, C, D, E, F, G, K;
float p, q;
printf ("Please enter the desired quantity");
scanf ("%d", &k);
Srand (Unsigned (Time (NULL)));
for (e = 0; e < K; e++)
{
A = rand ()% 100;
b = rand ()% 100;
c = rand ()% 5;
Switch (c)
{
Case 0:printf ("title%d:%d +%d =\n", E+1, A, b);
Break
Case 1:if (A < b)
{
D = A;
A = b;
b = D;
}
printf ("Title%d:%d-%d =\n", E+1, A, b);
Break
Case 2:printf ("title%d:%d *%d =\n", E+1, A, b);
Break
Case 3:
while (b = = 0)
{
b = rand ()% 100;
}
printf ("Title%d:%d/%d =\n", E+1, A, b);
Break
Case 4:
A = rand ()% 100;
b = rand ()% 100;
f = rand ()% 100;
g = rand ()% 100;
c = rand ()% 4;
while (b = = 0)
{
b = rand ()% 100;
}
while (g = = 0)
{
g = rand ()% 100;
}
if (a > B)
{
D = A;
A = b;
b = D;
}
if (F > G)
{
d = f;
f = g;
g = D;
}
Switch (c)
{
Case 0:printf ("title%d:%d/%d +%d/%d =\n", E+1, A, B, f, g);
Break
Case 1:
p = (float) A/(float) b;
Q = (float) f/(float) G;
if (P < q)
{
D = A;
A = f;
f = D;
D = b;
b = g;
g = D;
}
printf ("Title%d:%d/%d-%d/%d =\n", E+1, A, B, f, g);
Break
Case 2:printf ("title%d:%d/%d *%d/%d =\n", E+1, A, B, f, g);
Break
Case 3:
A = rand ()% 100;
b = rand ()% 100;
f = rand ()% 100;
g = rand ()% 100;
c = rand ()% 4;
while (f = = 0)
{
f = rand ()% 100;
}
printf ("title%d:%d/%d/%d/%d =\n", E+1, A, B, f, g);
Break
}
}
}
System ("pause");
return 0;
}
Summary: Although the use of C language to achieve most of the small program requirements, but still did not think of avoiding duplication of methods.
Two pillars of the software