MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
Amaliy ish Bajardi: 510-22 guruh talabasi
Qahramonova Farangiz
TOSHKENT 2022
13-variant
char turidagi A satrdagi har bir verguldan oldin, B satrdagi oʻzlarni
joylashtirish natijasida S satrini hosil qiluvchi dastur tuzing.
#include using namespace std;
char *nextWordOfCharArray(char *str, int *startIndex)
{
char word[100] = {};
int index = 0;
int i = *startIndex;
for (i; str[i] != ' ' && str[i] != '\0'; i++)
{
word[index] = str[i];
index++;
}
*startIndex = i + 1;
return word;
}
int main()
{
char A[100];
char B[100];
char S[200] = {};
cin.getline(A, 100);
cin.getline(B, 100);
{
cout << "{";
for (int i = 0; i < n; i++)
{
if (i == 0)
{
cout << str[i];
}
else {
if (str[i].size() == str[i - 1].size())
{
cout << ", " << str[i];
}
else {
cout << "}" << endl << "{" << str[i];
}
}
}
cout << "}";
}
int main()
{
string familiya[] = {
"Abdurahmonova",
"Abdullayev",
"Qurbonov",
"Mahmarahimova",
"Sodiqova"};
int n = sizeof(familiya) / sizeof(familiya[0]);
sort(familiya, n);
findEqualsLength(familiya, n);
return 0;
}
Berilgan nomdagi matnli faylni yaratish va unga satr kiritish dasturini tuzing.
Boshlanishi va tugashi bir xil harfdan iborat so’zni ekranga chiqaring.
#include #include using namespace std;
int main()
{
cout << "So'z kiriting: ";
cin >> word;
if (word[0] == word[word.length() - 1])
{
cout << "Boshi va oxiri bir xil harf: " << word[0];
}
else {
cout << "Bu so'z boshi va oxiri bir xil emas!";
}
return 0;
}
#include #include using namespace std;
int main()
{