32 Commits

Author SHA1 Message Date
7300b6f60f Удалить task5.cpp 2025-09-30 17:23:01 +03:00
8f3483480c Загрузить файлы в «/» 2025-09-30 17:22:37 +03:00
04f3343f0e Загрузить файлы в «/» 2025-09-30 15:12:52 +03:00
7dfb6397a6 Удалить task1.cpp 2025-09-30 15:12:38 +03:00
a48d56af9c Удалить task2.cpp 2025-09-30 15:12:33 +03:00
70cc38a754 Удалить tak3.cpp 2025-09-30 15:12:29 +03:00
25e99a12b8 Удалить summa.cpp 2025-09-30 15:12:24 +03:00
2897bf3465 Удалить sum.cpp 2025-09-30 15:12:21 +03:00
bab8e10eaa Удалить sum_calculator.cpp 2025-09-30 15:12:17 +03:00
581c38c331 Удалить remove_digits.cpp 2025-09-30 15:12:13 +03:00
48bdb950ba Удалить rectangle.cpp 2025-09-30 15:12:10 +03:00
88dd65175d Удалить range_checker.cpp 2025-09-30 15:12:06 +03:00
7c613a6c9c Удалить profit_analysis.cpp 2025-09-30 15:12:03 +03:00
e3f16c26e0 Удалить profit_6_months.cpp 2025-09-30 15:12:00 +03:00
8c0b94e39f Удалить print.cpp 2025-09-30 15:11:57 +03:00
b1622b22f5 Удалить network1.sh 2025-09-30 15:11:53 +03:00
76a7ebca6a Удалить mult.cpp 2025-09-30 15:11:48 +03:00
fa9ce8bb84 Удалить mergedarray.cpp 2025-09-30 15:11:42 +03:00
de3c05365f Удалить maxElem.cpp 2025-09-30 15:11:39 +03:00
ffd9fef3e5 Удалить lucky_number.cpp 2025-09-30 15:11:34 +03:00
b9863c0a3d Удалить funny_test.cpp 2025-09-30 15:11:31 +03:00
4c4ca3ff7d Удалить find_max.cpp 2025-09-30 15:11:27 +03:00
0be7e0edf5 Удалить elements.cpp 2025-09-30 15:11:24 +03:00
590f0f7e4d Удалить elem2.cpp 2025-09-30 15:11:20 +03:00
741be19f13 Удалить elem1.cpp 2025-09-30 15:11:15 +03:00
1e0dde9f12 Удалить checer.cpp 2025-09-30 15:11:12 +03:00
cf6215df42 Удалить bSearch.cpp 2025-09-30 15:11:09 +03:00
6721725272 Удалить Arr1-Arr2.cpp 2025-09-30 15:11:04 +03:00
af0e943ada Удалить analysis.cpp 2025-09-30 15:11:00 +03:00
9925e72fda Удалить 123.cpp 2025-09-30 15:10:57 +03:00
11b094b95b Удалить tac3.cpp 2025-09-30 15:10:52 +03:00
b3dbc2bdb9 Загрузить файлы в «/» 2025-09-30 15:09:25 +03:00
4 changed files with 153 additions and 126 deletions

View File

@@ -1,21 +1,77 @@
#include <iostream> //#include <iostream>
#define SIZE 80 //
using namespace std; //using namespace std;
//
int main() //int main() {
{ // int s;
char str[SIZE]; // cout << "Size: ";
cout << "Input string: "; // cin >> s;
cin.getline(str, SIZE); // int t;
// cout << "Shape (1-left,2-right,3-up,4-down,5-square): ";
int i = 0; // cin >> t;
while (str[i] != '\0') { // if (s < 1) return 0;
if (str[i] == ' ') { // switch (t) {
str[i] = '\t'; // case 1: {
} // int i;
++i; // int j;
} // for (i = 1; i <= s; i++) {
// for (j = 1; j <= i; j++) cout << "*";
cout << "Modified string: " << str << endl; // cout << "\n";
system("pause"); // }
} // break;
// }
// case 2: {
// int i;
// int j;
// for (i = 1; i <= s; i++) {
// for (j = 1; j <= s - i; j++) cout << " ";
// for (j = 1; j <= i; j++) cout << "*";
// cout << "\n";
// }
// break;
// }
// case 3: {
// int i;
// int j;
// int k;
// for (i = 1; i <= s; i++) {
// for (j = 1; j <= s - i; j++) cout << " ";
// for (k = 1; k <= 2 * i - 1; k++) cout << "*";
// cout << "\n";
// }
// break;
// }
// case 4: {
// int i;
// int j;
// int k;
// for (i = s; i >= 1; i--) {
// for (j = 1; j <= s - i; j++) cout << " ";
// for (k = 1; k <= 2 * i - 1; k++) cout << "*";
// cout << "\n";
// }
// break;
// }
// case 5: {
// int i;
// int j;
// int k;
// for (i = s; i >= 1; i--) {
// for (j = 1; j <= s - i; j++) cout << " ";
// for (k = 1; k <= 2 * i - 1; k++) cout << "*";
// cout << "\n";
// }
// for (i = 1; i <= s; i++) {
// for (j = 1; j <= s - i; j++) cout << " ";
// for (k = 1; k <= 2 * i - 1; k++) cout << "*";
// cout << "\n";
// }
// break;
// }
// default: {
// cout << "Wrong choice\n";
// break;
// }
// }
// return 0;
//}

View File

@@ -1,53 +1,40 @@
#pragma warning(disable : 4996) //#include <iostream>
#define SIZE 80 //
#include <iostream> //using namespace std;
using namespace std; //
//int main() {
int mystrlen(const char* str) { // long long x;
int len = 0; // cout << "Number: ";
for (; str[len] != '\0'; ++len) {} // cin >> x;
return len; // long long y;
} // y = llabs(x);
// if (y == 0) {
char* mystrcat(char* str1, const char* str2) { // cout << "Digits: 1\n";
int i = mystrlen(str1); // cout << "Sum: 0\n";
int j; // cout << "Avg: 0\n";
for (j = 0; str2[j] != '\0'; ++j) { // cout << "Zeros: 1\n";
str1[i + j] = str2[j]; // return 0;
} // }
str1[i + j] = '\0'; // int c;
return str1; // c = 0;
} // int s;
// s = 0;
char* mystrchr(char* str, char s) { // int z;
for (int i = 0; str[i] != '\0'; ++i) { // z = 0;
if (str[i] == s) { // while (y > 0) {
return &str[i]; // int d;
} // d = y % 10;
} // s += d;
return 0; // if (d == 0) z++;
} // y /= 10;
// c++;
int main() { // }
char str1[SIZE]; // double a;
char str2[SIZE]; // a = (c == 0) ? 0.0 : (double)s / c;
cout << "Input first string: "; // cout << "Digits: " << c << "\n";
cin.getline(str1, SIZE); // cout << "Sum: " << s << "\n";
cout << "Input second string: "; // cout << "Avg: " << a << "\n";
cin.getline(str2, SIZE); // cout << "Zeros: " << z << "\n";
// return 0;
cout << "mystrlen(str1): " << mystrlen(str1) << endl; //}
cout << "mystrcat(str1, str2): " << mystrcat(str1, str2) << endl; //
char ch;
cout << "Input char to search in str1: ";
cin >> ch;
char* f = mystrchr(str1, ch);
if (f) {
cout << "mystrchr(str1, '" << ch << "): " << f << endl;
}
else {
cout << "mystrchr(str1, '" << ch << "): 0" << endl;
}
system("pause");
}

19
task3.cpp Normal file
View File

@@ -0,0 +1,19 @@
//#include <iostream>
//
//using namespace std;
//
//int main() {
// int k;
// k = 0;
// for (int i = 100; i <= 999; i++) {
// int a;
// a = i / 100;
// int b;
// b = (i / 10) % 10;
// int c;
// c = i % 10;
// if (a != b && a != c && b != c) k++;
// }
// cout << k << "\n";
// return 0;
//}

View File

@@ -1,53 +1,18 @@
#pragma warning(disable : 4996) #include <iostream>
#define SIZE 80
#include <iostream> using namespace std;
using namespace std;
int main() {
int mystrlen(const char* str) { long long n;
int len = 0; cout << "Number: ";
for (; str[len] != '\0'; ++len) {} cin >> n;
return len; long long m;
} m = llabs(n);
if (m == 0) {
char* mystrcat(char* str1, const char* str2) { cout << "All integers divide 0\n";
int i = mystrlen(str1); return 0;
int j = mystrlen(str2); }
for (int k = 0; k < j; ++k) { for (long long i = 1; i <= m; i++) if (m % i == 0) cout << i << " ";
str1[i + k] = str2[k]; cout << "\n";
} return 0;
str1[i + j] = '\0';
return str1;
}
char* mystrchr(char* str, char s) {
for (int i = 0; str[i] != '\0'; ++i) {
if (str[i] == s) {
return &str[i];
}
}
return 0;
}
int main() {
char str1[SIZE];
char str2[SIZE];
cout << "Input first string: ";
cin.getline(str1, SIZE);
cout << "Input second string: ";
cin.getline(str2, SIZE);
cout << "mystrlen(str1): " << mystrlen(str1) << endl;
cout << "mystrcat(str1, str2): " << mystrcat(str1, str2) << endl;
char ch;
cout << "Input char to search in str1: ";
cin >> ch;
char* f = mystrchr(str1, ch);
if (f) {
cout << "mystrchr(str1, '" << ch << "'): " << f << endl;
}
else {
cout << "mystrchr(str1, '" << ch << "'): 0" << endl;
}
system("pause");
} }