首页 > 其他 > 详细

二柱子的疑难杂症

时间:2018-10-08 19:23:33      阅读:118      评论:0      收藏:0      [点我收藏+]
 #include <stdio.h>

#include <stdlib.h>

#include <time.h>

int main() { 

int i;

    int num1, num2;

    int  op,result, score=0;

    char oper[]={‘+‘,‘-‘,‘*‘,‘/‘};

    srand(time(0));



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

    {

        printf("第%d题 ", i+1);

        num1 = rand()%101;

        num2 = rand()%101;

        op = rand()%4;

        switch(op){

            case 0:

            printf("%d %c %d = \n", num1, oper[op], num2);

              break;

            case 1:

             printf("%d %c %d = \n", num1, oper[op], num2);

               break;

            case 2:

              printf("%d %c %d = \n", num1, oper[op], num2);

                break;

            case 3:

              printf("%d %c %d = \n", num1, oper[op], num2);

              break;

        }

}    

    return 0;

技术分享图片

 

二柱子的疑难杂症

原文:https://www.cnblogs.com/980412peanut/p/9756165.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!