- 博客(8)
- 收藏
- 关注
原创 #C++比较字符串大小#
#include <iostream> using namespace std; int mystrcmp(const char* src, const char* dst); int main() { char s1[100] = { 0 }; char s2[100] = { 0 }; cin.getline(s1, sizeof(s1)); cin.getline(s2, sizeof(s2)); int ret = mystrcmp(s1, s2); cout .
2022-05-30 21:45:31
287
原创 #C++创建二维动态数组#
#include<iostream> using namespace std; int main() { int n; cin >> n; // write your code here...... int **a = new int*[n]; for (int i = 0; i < n; i++) { a[i] = new int[n]; } for (int i = 0; i < n; i++) { for (int j = 0; j &l.
2022-05-30 21:36:28
86
原创 #C++复制部分字符串#
#include <iostream> using namespace std; int main() { /*helloworld 6 world*/ char str[30] = { 0 }; cin.getline(str,sizeof(str)); int m; cin >> m; char * p = str+m-1; while (*p != '\0') { cout &l...
2022-05-30 21:33:19
172
原创 #C++选择排序#
#include <iostream> using namespace std; int main() { int arr[6] = { 0 }; int len = sizeof(arr) / sizeof(int); for (int i = 0; i < len; i++) { cin >> arr[i]; } // write your code here...... int max = arr[0...
2022-05-30 21:31:01
85
原创 #C++冒泡排序#
#include <iostream> using namespace std; int main() { int arr[6] = { 0 }; int len = sizeof(arr) / sizeof(int); for (int i = 0; i < len; i++) { cin >> arr[i]; } // write your code here...... int tem; for (int j = len; j > 1; .
2022-05-30 21:28:24
100
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人