zoukankan      html  css  js  c++  java
  • C语言寒假大作战02

    二、本周作业头

    这个作业属于那个课程 寒假作业
    这个作业要求在哪里 https://edu.cnblogs.com/campus/zswxy/CST2019-2/homework/10261
    这个作业的目标是 编写简单的菜单程序
    这个作业正文 https://i-beta.cnblogs.com/posts/edit
    参考文献 百度、《C Prime Plus》

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

    菜单程序函数调用图:

    遇到的问题

    写代码的时候,写switch语句时,不记得用while语句循环使用,然后没写出来,后来看了一下别人的代码,知道自己的出错,然后上传到仓库时,我竟然不知到怎么上传了,然后使用了上传文件
    

    2. 程序结果截图:



    3. 程序代码:

    #include<stdio.h>
    void help(){
    	printf("帮助信息:
    您需要输入命令代号来进行操作,且
    一年级题目为不超过十位的加减法;
    二年级题目为不超过百位的乘除法;
    三年级题目为不超过百位的加减乘除混合题目.
    
    ");
    }
    void menu(){
    	printf("操作列表:
    1)一年级    2)二年级    3)三年级
    4)帮助     5)退出程序
    请输入操作>");
    }
    void Grade1(){
    	printf("现在是一年级题目:
    ");
    }
    void Grade2(){
        printf("现在是二年级题目:
    ");
    }
    void Grade3(){
        printf("现在是三年级题目:
    ");
    } 
    void error(){
        printf("Error!!!
    错误操作指令,请重新输入
    
    "); 
    }
    int main()
    {
    	int c=1;
    	printf("========口算生成器========
    欢迎使用口算生成器:)
    
    ");
        help();
        menu();
        while(c!=5){
        	scanf("%d",&c);
        	printf("<执行操作:)
    ");
        	printf("
    ");
        	switch(c){
        	    case 1:Grade1();break;
                case 2:Grade2();break;
                case 3:Grade3();break;
                case 4:help();break;
                case 5:printf("程序结束,欢迎下次使用  任意键结束......
    ");break;
                default:error();break;
    		}
    		if(c!=5)menu();
    	}	
    	return 0;
    }
    

    4. 你对"设计"这个词的理解

    设计,可以说是打造自己想要的东西;也可以说是创新,采取新奇的点子来实现自己所需要的;设计可以说是交流来完善生活,是一个赋予作品感情的最好的表达,带给其生命力。
    

    5. Gitee上传截图与链接


    Gitee链接

    https://gitee.com/gaoming_1314

  • 相关阅读:
    LeetCode "Palindrome Partition II"
    LeetCode "Longest Substring Without Repeating Characters"
    LeetCode "Wildcard Matching"
    LeetCode "Best Time to Buy and Sell Stock II"
    LeetCodeEPI "Best Time to Buy and Sell Stock"
    LeetCode "Substring with Concatenation of All Words"
    LeetCode "Word Break II"
    LeetCode "Word Break"
    Some thoughts..
    LeetCode "Longest Valid Parentheses"
  • 原文地址:https://www.cnblogs.com/gm12/p/12275358.html
Copyright © 2011-2022 走看看