zoukankan      html  css  js  c++  java
  • 软件工程(个人项目2)

    添加新要求

    1、支持真分数

    2、题目避免重复

    3、可定制数量

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <time.h>

    int main()
    {
    int i,a,b,c,d,m;
    for(i=0;i<30;i++)
    {
    a=rand()%(10-1+1)+1;
    b=rand()%(10-1+1)+1;
    c=rand()%(10-1+1)+1;
    d=rand()%(10-1+1)+1;
    m=rand()%(4-1+1)+1;
    {
    if((m==1)&(a<b)&(c<d))
    printf("(%d/%d)+(%d/%d)= ",a,b,c,d);
    if((m==1)&(a>b)&(c<d))
    printf("(%d/%d)+(%d/%d)= ",b,a,c,d);
    if((m==1)&(a<b)&(c>d))
    printf("(%d/%d)+(%d/%d)= ",a,b,d,c);
    if((m==1)&(a>b)&(c>d))
    printf("(%d/%d)+(%d/%d)= ",b,a,d,c);
    if((m==2)&(a<b)&(c<d))
    printf("(%d/%d)-(%d/%d)= ",a,b,c,d);
    if((m==2)&(a>b)&(c<d))
    printf("(%d/%d)-(%d/%d)= ",b,a,c,d);
    if((m==2)&(a<b)&(c>d))
    printf("(%d/%d)-(%d/%d)= ",a,b,d,c);
    if((m==2)&(a>b)&(c>d))
    printf("(%d/%d)-(%d/%d)= ",b,a,d,c);
    if((m==3)&(a<b)&(c<d))
    printf("(%d/%d)*(%d/%d)= ",a,b,c,d);
    if((m==3)&(a>b)&(c<d))
    printf("(%d/%d)*(%d/%d)= ",b,a,c,d);
    if((m==3)&(a<b)&(c>d))
    printf("(%d/%d)*(%d/%d)= ",a,b,d,c);
    if((m==3)&(a>b)&(c>d))
    printf("(%d/%d)*(%d/%d)= ",b,a,d,c);
    if((m==4)&(a<b)&(c<d))
    printf("(%d/%d)/(%d/%d)= ",a,b,c,d);
    if((m==4)&(a>b)&(c<d))
    printf("(%d/%d)/(%d/%d)= ",b,a,c,d);
    if((m==4)&(a<b)&(c>d))
    printf("(%d/%d)/(%d/%d)= ",a,b,d,c);
    if((m==4)&(a>b)&(c>d))
    printf("(%d/%d)/(%d/%d)= ",b,a,d,c);
    }
    }
    printf("按任意键查看答案");

    getchar();
    return 0;

    }

  • 相关阅读:
    VS2015 出现 .NETSystem.Runtime.Remoting.RemotingException: TCP 错误
    C#学习笔记------参数
    C#简单工厂和抽象类的实例
    css基础1
    html中的div span和frameset框架标签
    关于C#委托的一些学习笔记
    html基础加强2
    HTML基础加强
    利用GDI+在Winfrom绘制验证码
    winfrom如何在listview中添加控件
  • 原文地址:https://www.cnblogs.com/cc173640639/p/9751732.html
Copyright © 2011-2022 走看看