​正确例题

#include


【资料图】

#include

#include

void main()

{

int a,b,i,j;

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

{

a = rand()%100;

b = rand()%100;

{

printf("%d + %d = %d\n",a,b,a+b);

}

printf("%d - %d = %d\n",a,b,a-b);

}

printf("%d × %d = %d\n",a,b,a*b);

}

正确例题

#include

#include

#include

void main()

{

int a,b,i,j;

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

{

for(j = 0;j < 10;j++)

{

a = rand()%100;

b = rand()%100;

{

printf("%d + %d = %d\n",a,b,a+b);

}

printf("%d - %d = %d\n",a,b,a-b);

}

printf("%d × %d = %d\n",a,b,a*b);

}

}

正确例题

#include

#include

#include

void main()

{

int a,b,i,j,k;

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

{

for(j = 0;j < 10;j++)

{

a = rand()%100;

b = rand()%100;

{

printf("%d + %d = %d\n",a,b,a+b);

}

printf("%d - %d = %d\n",a,b,a-b);

}

printf("%d × %d = %d\n",a,b,a*b);

}

float a,b;

for(k = 0;k < 10;k++)

{

a = rand()%100;

b = rand()%100;

printf("%.0f÷%.0f=%f\n",a,b,a / b);

}

}

正确例题

#include

#include

#include

int main()

{

int i,j,a,b;

srand((unsigned)time(NULL));

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

{

a= rand()%99+1;

b= rand()%99+1;

a>b?printf("%2d-%2d = %2d\n",a,b,a-b):printf("%2d+%2d = %2d\n",a,b,a+b);

}

}

正确例题

#include

#include

#include

int main()

{

int i,j,a,b;

srand((unsigned)time(NULL));

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

{

a= rand()%99+1;

b= rand()%99+1;

if(a>b);printf("%2d-%2d = %2d\n",a,b,a-b);printf("%2d+%2d = %2d\n",a,b,a+b);

}

}

正确例题

#include

#include

#include

int main()

{

int i,j,a,b;

srand((unsigned)time(NULL));

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

{

a= rand()%99+1;

b= rand()%99+1;

if(a>b);printf("%2d-%2d = %2d\n",a,b,a-b);printf("%2d+%2d = %2d\n",a,b,a+b);

float a,b;

a = rand()%100;

b = rand()%100;

printf("%.0f÷%.0f=%f\n",a,b,a / b);

}

}

正确例题<全面混合运算>

#include

#include

#include

int main()

{

int i,j,a,b;

srand((unsigned)time(NULL));

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

{

a= rand()%99+1;

b= rand()%99+1;

if(a>b);

printf("%2d-%2d = %2d\n",a,b,a-b);

printf("%2d+%2d = %2d\n",a,b,a+b);

printf("%2d×%2d = %2d\n",a,b,a*b);

float a,b;

a = rand()%100;

b = rand()%100;

printf("%.0f÷%.0f=%f\n",a,b,a / b);

}

}

关键词: