Two pillars of the software

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.