update 2024/10/5

This commit is contained in:
Dengrb 2024-10-05 14:00:07 +08:00
parent 3aa787feb8
commit 8e79158b9d
3 changed files with 55 additions and 0 deletions

Binary file not shown.

Binary file not shown.

55
homework_2.cpp Normal file
View File

@ -0,0 +1,55 @@
#include<iostream>
#include<windows.h>
#include<cstdlib>
using namespace std;
void shi_d;
void bai1;
int main(){
cout <<"请输入完成的操作(1.百位计算2.十位计算)";
int in;
cin >>in;
if (in==Unknown)
{
cout <<"你没有输入数字!";
Sleep(1250);
return 1;
}else if (in==1)
{
bai1();
}else if (in==2)
{
shi_d;
}else{
cout <<"输入错误!请重新运行程序并输入正确的编号!";
Sleep(1250);
return 1;
}
}
void shi_d(){
int number,shi1,ge;
cout <<"请输入一个十位数字:";
cin >>number;
if (number==Unknown)
{
cout <<"你没有输入数字!";
Sleep(1250);
exit(0);
}
//计算模块
ge = number % 10;
shi1 = number / 10 % 10;
number = ge + shi1;
cout <<"结果为"<<number<<endl; //输出
Sleep(1500);
exit(0);
}
void bai1(){
exit(0);
}