小学四则运算初级版

#include<stdio.h>

#include <stdlib.h>

int main()

{

    int i,a,b,c,d;

       printf("这是我编辑的简易四则运算\n");

      

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

       {

       a=rand()%(99-0+1)+0;

       b=rand()%(99-0+1)+0;

       c=rand()%(4-1+1)+1;

      

       switch(c)

       {

       case(1):printf("%d+%d=\n",a,b);break;

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

       case(3):printf("%d*%d=\n",a,b);break;

       case(4):printf("%d/%d=\n",a,b);break;

       default:printf("错误!\n");

       }

       }

     

    return 0;

}

猜你喜欢

转载自www.cnblogs.com/gaoemm/p/9726594.html
今日推荐