C语言寒假大作战03

1. 本周作业头

这个作业属于哪个课程 班级作业链接
这个作业要求在哪里 作业要求的链接
这个作业的目标 使用函数、Switch语句来完成菜单程序
作业正文 https://www.cnblogs.com/Litinga/p/12286593.html
其他参考文献 参考资料

2. 设计思路和遇到的问题

心路历程:平淡,内心毫无波动-->好难-->借鉴别人的博客-->写完了
程序设计思路:在上次作业的基础上,利用rand()函数添加题目
**遇到的问题:三年级的加减乘除混合运算不太会


3. 程序结果截图

C语言寒假大作战03_第1张图片
C语言寒假大作战03_第2张图片
C语言寒假大作战03_第3张图片


4.程序代码截图

#include
#include 
void yinianji()
{
    printf("执行操作\n");
    printf("\n");
    printf("现在是一年级题目:\n");
    printf("请输入生成题目数目:\n");
    int x;
    scanf("%d",&x), 
    printf("执行操作:\n");
    int a;
    for(int i;i<10;i++)
    {
        a = rand()%2;
        if(a==1)
        printf("%d + %d =  \n",rand()%11,rand()%11);
        else
        printf("%d - %d =  \n",rand()%11,rand()%11);
    }
    printf("\n");
 }
 void ernianji()
 {
    int y;
    printf("执行操作\n");
    printf("\n");
    printf("现在是二年级题目:\n");
    printf("请输入生成题目数目:\n");
    scanf("%d",&y); 
    printf("执行操作\n");
    int b;
    for(int i;i

5. Gitee上传截图与链接

  • 截图:C语言寒假大作战03_第4张图片
  • 链接:https://gitee.com/li_tinga/C-Gaming

你可能感兴趣的:(C语言寒假大作战03)