斯坦计算器电脑版更新至9.1.2版本

7980 5
鹰眼(流星) 2022-4-22 21:13:55 | 显示全部楼层 |阅读模式
Hello,  我们又见面了,老样子,我这次任然是对于斯坦计算器的更新,以目前的情况来看,斯坦计算器应该不会有太大的进展,所以本次更新主要是完善功能,从原来的200多行到了300多行,目录增加了一个类型,程序代码如下:

#include <stdio.h>
#include <stdlib.h>
#define SN 3.14

int xxx = 1;
int vvv = 0;

double aa1 = 0;
double aa2 = 0;

double ac1 = 0;
double ac2 = 0;

void GM()//标签
{
        system("cls");
    printf("============================================================================================================================================================================================================================================\n");
    printf("\t\t\t\t\t\t\t\t\t\t\t\t\t       Stein calculator\n");
    printf("============================================================================================================================================================================================================================================\n");
    printf("\n\n");
}
void GM1()//标签
{
        system("cls");
    printf(">>Operations of addition and subtraction and multiplication and division-----------------------------------\n");
    printf("\n\n");
}
void GM2()//标签
{
        system("cls");
    printf(">>Wheel calculation(+--+)----------------------------------------------------------------------------------\n");
    printf("\n\n");
}
void GM3()//标签
{
        system("cls");
    printf(">>Cylinder operation---------------------------------------------------------------------------------------\n");
    printf("\n\n");
}
void NNO()//错误判断
{
        GM();
    printf("SIGN INPUT ERROR!\n");
}
void AA1()//有余数的除法
{
        int n = 0;
    int b = 0;
    printf("Please enter the dividend:\n");
    scanf("%d", &n);
    if(n == 0)
    {
            GM1();
        printf("SIGN INPUT ERROR!\n");
    }
    else
    {
        printf("Please enter the divisor:\n");
        scanf("%d", &b);
        printf("%d / %d = %d     %d\n", n, b, n / b, n % b);
        }
}
void AA2()//没有余数的除法
{
        printf("Please enter the dividend:\n");
    scanf("%lf", &aa1);
    if(aa1 == 0)
    {
            GM1();
        printf("SIGN INPUT ERROR!\n");
    }
    else
    {
        printf("Please enter the divisor:\n");
        scanf("%lf", &aa2);
        printf("%f / %f = %f\n", aa1, aa2, aa1 / aa2);
    }
}
void AA3()//加法
{
        printf("Please enter an addition1:\n");
    scanf("%lf", &aa1);
    printf("Please enter an addition2:\n");
    scanf("%lf", &aa2);
    printf("%f + %f = %f\n", aa1, aa2, aa1 + aa2);
}
void AA4()//减法
{
        printf("Please enter the minus number1:\n");
    scanf("%lf", &aa1);
    printf("Enter the minus number2:\n");
    scanf("%lf", &aa2);
    printf("%f - %f = %f\n", aa1, aa2, aa1 - aa2);
}
void AA5()//乘法
{
        printf("Please enter the multiplier1:\n");
    scanf("%lf", &aa1);
    printf("Please enter the multiplier2:\n");
    scanf("%lf", &aa2);
    printf("%f * %f = %f\n", aa1, aa2, aa1 * aa2);
}
void AA6()//除法集体
{
    int yu;
        printf("Is there a remainder?(There are 1, but only the total number of support!):\n");
    scanf("%d", &yu);
    GM1();
    if(yu == 1)
    {
        AA1();
    }
    else
    {
        AA2();
    }
}
void AAX1()//开始运算
{
    int h;
        GM1();
    printf("Please enter mode?\naddition=1\nsubtraction=2\nmultiplication=3\ndivision=4\n");
    scanf("%d", &h);
    GM1();

    if(h == 1)
    {
        AA3();
    }
    else if(h == 2)
    {
        AA4();
    }
    else if(h == 3)
    {
        AA5();
    }
    else if(h == 4)
    {
        AA6();
    }
    else
    {
        NNO();
    }
}
void AB1()//计算后齿轮齿数
{
    GM2();
    double nn, xx;
    printf("Please enter a number (front gear) :");
    scanf("%lf", &nn);
    printf("Please enter a number (after the number of rotation of the gears) :");
    scanf("%lf", &xx);
    double nx = nn / xx;
    printf("The number of teeth in the rear gear is:%lf\n", nx);
}
void AB2()//计算前齿轮齿数
{
    GM2();
    double nn, xx;
    printf("Please enter a number (rear gear) :");
    scanf("%lf", &nn);
    printf("Please enter a number (after the number of rotation of the gears) :");
    scanf("%lf", &xx);
    double nx = nn * xx;
    printf("The number of teeth of the front gear is:%lf\n", nx);
}
void AB3()//计算前齿轮轮数
{
    GM2();
    double nn, xx;
    printf("Please enter a number (rear gear) :");
    scanf("%lf", &nn);
    printf("Please Please enter a number (front gear) :");
    scanf("%lf", &xx);
    double nx = nn / xx;
    printf("The number of wheels of the front gear is:%lf\n", nx);
}
void AB4()//计算后齿轮轮数
{
    GM2();
    double nn, xx;
    printf("Please enter a number (front gear) :");
    scanf("%lf", &nn);
    printf("Please enter a number (rear gear) :");
    scanf("%lf", &xx);
    double nx = nn / xx;
    printf("The number of wheels of the rear gear is:%lf\n", nx);
}
void ABX1()//开始运算
{
    int h;
        GM2();
    printf("Please enter mode?\n1. Number of teeth of rear gear \n2. Number of teeth of front gear \n3. Number of weeks of rotation of front gear \n4. Number of weeks of rotation of rear gear\n");
    scanf("%d", &h);
    GM2();

    if(h == 1)
    {
        AB1();
    }
    else if(h == 2)
    {
        AB2();
    }
    else if(h == 3)
    {
        AB3();
    }
    else if(h == 4)
    {
        AB4();
    }
    else
    {
        NNO();
    }
}
void AC1()//数据提供
{
        GM3();
    printf("Please enter radius:");
    scanf("%lf", &ac1);
    printf("Please enter height:");
    scanf("%lf", &ac2);
}
void AC2()//圆柱体积
{
        GM3();
        double s;
    s = ac1 * ac1 * SN * ac2;
    printf("The volume of a cylinder is %lf\n", s);
}
void AC3()//圆柱面积
{
        GM3();
    double s;
    s = ac1 * ac1 * SN * 2 + ac1 * 2 * SN * ac2;
    printf("The area of the cylinder is %lf\n", s);
}
void ACX1()
{
        GM3();
    int h;
    printf("Please enter the type to be calculated?\nvolume = 1\narea = 2\n");
    scanf("%d", &h);
    if(h == 1)
    {
            AC1();
        AC2();
    }
    else if(h == 2)
    {
            AC1();
        AC3();
    }
    else
        NNO();
}
void VVV()//目录
{
        GM();
    printf("\t\t\t\t\t\t\t\t\t\t\t\t\t      /Table of contents/\n");
    printf("1.Operations of addition and subtraction and multiplication and division\n");
    printf("2.Wheel calculation(+--+)\n");
    printf("3.Cylinder operatio\n");
        printf("\n\n\n\n\n\n\n\n\nPlease enter mode?\n");
    scanf("%d", &vvv);
    if(vvv == 1)
        AAX1();
    else if(vvv == 2)
        ABX1();
    else if(vvv == 3)
        ACX1();
    else
        NNO();
}
void XXX()//退出运算流程
{
    printf("Whether to continue (exit: 1):\n");
    scanf("%d", &xxx);
    GM();

    if(xxx == 1)
    xxx = 0;
    else
    xxx = 1;
}
int main(void)
{
    while(xxx == 1)
    {
        VVV();
        //进入运算流程
        XXX();
                //退出运算流程
    }
    printf("Bay-bay");
        return 0;//退出程序
}



我目前没有什么头绪,愿各位同胞指点一下。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
小远实名认证 2022-4-23 04:19:42 来自手机 | 显示全部楼层
还好解决了

点评

请问是从“根”上面解决了吗?  详情 回复 发表于 2022-4-23 18:47
谢谢  详情 回复 发表于 2022-4-23 18:38
鹰眼(流星) 2022-4-23 18:38:11 | 显示全部楼层

谢谢
鹰眼(流星) 2022-4-23 18:47:08 | 显示全部楼层

请问是从“根”上面解决了吗?
tyrock1010 2022-5-19 08:28:37 | 显示全部楼层
学习,学习,感谢!
鹰眼(流星) 2022-5-21 19:41:46 | 显示全部楼层



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2026 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行