diff --git "a/exercise/LC0001_\351\273\204\351\223\255\347\216\245.cpp" "b/exercise/LC0001_\351\273\204\351\223\255\347\216\245.cpp" new file mode 100644 index 0000000000000000000000000000000000000000..eaf9d785668cced1c936903946becf26acf6981a --- /dev/null +++ "b/exercise/LC0001_\351\273\204\351\223\255\347\216\245.cpp" @@ -0,0 +1,17 @@ +#include +using namespace std; + +class Solution { +public: + vector twoSum(vector& nums, int target) { + int i , j; + for(i = 0 ; i < nums.size() ; i ++){ + for(j = i + 1 ; j < nums.size() ; j ++){ + if(nums[i] + nums[j] == target){ + return {i , j}; + } + } + } + return {i , j}; + } +};