3.10四则运算

#include<stdio.h>

#include<stdbli.h>

#include<time.h>

#define N 300

int main(int argc,const char*argv[])

{

int i,j;

int n1,n2,bs;

char ops[4]={'+','-','*','/'};

srand((unsigned)time(NULL));

for(i=0;i<N;i++)

{

n1=rand()%100;

j=rand()%4;

n2=rand()%100+1;

if(j==3)

{

bs=rand()%25+1;

n1=bs*2;

}

printf("%d%c%d= ",n1,ops[j],n2);

}

return 0;

}

原文地址:https://www.cnblogs.com/wu1997/p/8538961.html