update 2024/10/5
This commit is contained in:
parent
3aa787feb8
commit
8e79158b9d
BIN
change.exe
BIN
change.exe
Binary file not shown.
BIN
homework.exe
BIN
homework.exe
Binary file not shown.
55
homework_2.cpp
Normal file
55
homework_2.cpp
Normal 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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user