四则运算

#include<cstdio>
#include<cstdlib>
#define random(x) (rand()%x)
int main()
{
    for(int i=0;i<300;i++){
        int c = random(4);
        int a = rand();
        int b = rand();
        if(c==0){
            printf("%d + %d = ",a,b);
        }
        else if(c==1){
            printf("%d - %d = ",a,b);
        }
        else if(c==2){
            printf("%d * %d = ",a,b);
        }
        else if(c==3){
            printf("%d / %d = ",a,b);
        }
    }
    return 0;
}

原文地址:https://www.cnblogs.com/DandelionClaw/p/8531160.html