diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 89bd7bf..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -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 -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 93dc78b..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -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 - } - ] - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index bb879da..0cba2e6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,59 +1,5 @@ { - "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 + "files.associations": { + "iostream": "cpp" + } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 2161d88..c275107 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,7 +3,7 @@ { "type": "cppbuild", "label": "C/C++: g++.exe 生成活动文件", - "command": "D:\\TDM-GCC\\bin\\g++.exe", + "command": "F:\\TDM-gcc\\bin\\g++.exe", "args": [ "-fdiagnostics-color=always", "-g", diff --git a/homework_new.cpp b/homework_new.cpp new file mode 100644 index 0000000..5849666 --- /dev/null +++ b/homework_new.cpp @@ -0,0 +1,38 @@ +#include +#include +#include + +using namespace std; + +int main(){ + string username,password; + string uname,pwd; + + username = "2022110"; + password = "246810"; //设置密码和用户名 + + cout <<"欢迎使用登录系统(demo)"<>uname; + cout <<"请输入密码:"; + cin >>pwd; + + if (uname == username) + { + if (pwd == password) + { + cout <<"亲爱的小朋友欢迎您!"; + Sleep(1000); + return 0; + }else{ + cout <<"密码错误!"; + Sleep(1000); + return 2; + } + }else{ + cout <<"用户名不正确!"; + Sleep(1000); + return 1; + } + return 0; +} \ No newline at end of file diff --git a/homework_newplus.cpp b/homework_newplus.cpp new file mode 100644 index 0000000..80c7c3a --- /dev/null +++ b/homework_newplus.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +using namespace std; + +int main(){ + string username,password; + string uname,pwd; + + username = "2022110"; + password = "246810"; //设置密码和用户名 + + cout <<"欢迎使用登录系统(demo)"< 0;time = time - 1) //反复与计数器 + { + int time_out = time -1; + cout <<"请输入用户名:"; //输入用户名 + cin >>uname; + cout <<"请输入密码:"; //输入密码 + cin >>pwd; + + if (uname == username) //验证用户名是否正确 + { + if (pwd == password) //验证密码是否正确 + { + cout <<"用户名与密码正确!亲爱的小朋友欢迎您!"; //密码与用户名正确的处理 + Sleep(1370); + return 0; + }else{ + cout <<"密码错误!你还剩下"< +#include +#include + +using namespace std; + +int main() { + double r; + const double PI = 3.14; + cout << "\u8f93\u5165\u534a\u5f84: "; + cin >> r; + + if (r < 0 || r > 100) { + cout << "\u8f93\u5165\u9519\u8bef: \u534a\u5f84\u5fc5\u987b\u4e3a0\u5230100\u4e4b\u95f4" << endl; + return 1; + } + + double volume = (4.0 / 3) * PI * pow(r, 3); + + cout << fixed << setprecision(2); + cout << "\u4f53\u79ef: " << volume << endl; + + return 0; +} diff --git a/homework_laster.cpp b/old_homework/homework_laster.cpp similarity index 100% rename from homework_laster.cpp rename to old_homework/homework_laster.cpp diff --git a/maths.cpp b/old_homework/maths.cpp similarity index 100% rename from maths.cpp rename to old_homework/maths.cpp