update 十万位

This commit is contained in:
Dengrb 2024-10-07 09:45:51 +08:00
parent 98ed1e7b68
commit fd73f1c067
6 changed files with 29 additions and 103 deletions

View File

@ -1,18 +0,0 @@
{
"configurations": [
{
"name": "windows-gcc-x64",
"includePath": [
"${workspaceFolder}/**"
],
"compilerPath": "D:/TDM-GCC/bin/gcc.exe",
"cStandard": "${default}",
"cppStandard": "${default}",
"intelliSenseMode": "windows-gcc-x64",
"compilerArgs": [
""
]
}
],
"version": 4
}

24
.vscode/launch.json vendored
View File

@ -1,24 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Runner: Debug Session",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"externalConsole": true,
"cwd": "c:/Users/Admin/gitee/code",
"program": "c:/Users/Admin/gitee/code/build/Debug/outDebug",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

59
.vscode/settings.json vendored
View File

@ -1,59 +0,0 @@
{
"C_Cpp_Runner.cCompilerPath": "gcc",
"C_Cpp_Runner.cppCompilerPath": "g++",
"C_Cpp_Runner.debuggerPath": "gdb",
"C_Cpp_Runner.cStandard": "",
"C_Cpp_Runner.cppStandard": "",
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
"C_Cpp_Runner.useMsvc": false,
"C_Cpp_Runner.warnings": [
"-Wall",
"-Wextra",
"-Wpedantic",
"-Wshadow",
"-Wformat=2",
"-Wcast-align",
"-Wconversion",
"-Wsign-conversion",
"-Wnull-dereference"
],
"C_Cpp_Runner.msvcWarnings": [
"/W4",
"/permissive-",
"/w14242",
"/w14287",
"/w14296",
"/w14311",
"/w14826",
"/w44062",
"/w44242",
"/w14905",
"/w14906",
"/w14263",
"/w44265",
"/w14928"
],
"C_Cpp_Runner.enableWarnings": true,
"C_Cpp_Runner.warningsAsError": false,
"C_Cpp_Runner.compilerArgs": [],
"C_Cpp_Runner.linkerArgs": [],
"C_Cpp_Runner.includePaths": [],
"C_Cpp_Runner.includeSearch": [
"*",
"**/*"
],
"C_Cpp_Runner.excludeSearch": [
"**/build",
"**/build/**",
"**/.*",
"**/.*/**",
"**/.vscode",
"**/.vscode/**"
],
"C_Cpp_Runner.useAddressSanitizer": false,
"C_Cpp_Runner.useUndefinedSanitizer": false,
"C_Cpp_Runner.useLeakSanitizer": false,
"C_Cpp_Runner.showCompilationTime": false,
"C_Cpp_Runner.useLinkTimeOptimization": false,
"C_Cpp_Runner.msvcSecureNoWarnings": false
}

2
.vscode/tasks.json vendored
View File

@ -3,7 +3,7 @@
{
"type": "cppbuild",
"label": "C/C++: g++.exe 生成活动文件",
"command": "D:\\TDM-GCC\\bin\\g++.exe",
"command": "C:\\TDM-GCC-64\\bin\\g++.exe",
"args": [
"-fdiagnostics-color=always",
"-g",

Binary file not shown.

View File

@ -7,11 +7,12 @@ void shi_d();
void bai1(); //定义函数
void qian();
void wan();
void shi_wan();
int main(){
//选择
cout <<"欢迎使用数字组合器!"<<endl;
cout <<"选择: 1.十位 2.百位 3.千位 4.万位 5.退出"<<endl;
cout <<"选择: 1.十位 2.百位 3.千位 4.万位 5.十万位 6.退出"<<endl;
cout <<"请输入完成的操作:";
int in;
cin >>in;
@ -28,6 +29,9 @@ int main(){
{
wan();
}else if (in==5)
{
shi_wan();
}else if (in==6)
{
exit(0);
}
@ -117,4 +121,27 @@ void wan(){
cout <<"结果为:"<<number; //输出结果
Sleep(1500);
exit(0);
}
void shi_wan(){
cout <<"现在是十万位计算"<<endl; //说明
cout <<"请输入一个十万位的数字(100000):";
int number; //输入
cin >>number;
//计算模块
int ge,shi,bai,qian,wan,shi_wan1;
ge = number % 10;
shi = number / 10 % 10;
bai = number /100 % 10;
qian = number / 1000 % 10;
wan = number / 10000 % 10;
shi_wan1 = number / 100000;
number = ge + shi + bai + qian + wan + shi_wan1;
//输出结果
cout <<"结果为:"<<number;
Sleep(1500);
exit(0);
}