|
"Dasturlash"
|
Sana | 12.12.2023 | Hajmi | 1,55 Mb. | | #116961 |
Bog'liq Porshenli nasoslar va ularning asosiy parametrlari, tuzilishi va, 11 SECRETS TO MEMORIZE THINGS QUICKER THAN OTHERS, 1677743744, 00000000000000000000000000000000000000, Academic-Data-388191100377, Муратов Абубакир, 2-deadline Farid, 132, lap, jaxon adabiyati songisi, Atom odatlari, 6 Kraxmalli pekmez ishlab chiqarish texnologik sxemasi, АУДИТ, DTST 1-lab
Muhammad Al-Xorazmiy nomidagi Toshkent axborot texnologiyalari universiteti
"Dasturlash"
4-amaliy topshiriq
Bajaruvchi:Qobiljonov Diyorbek
Gruh(1-b-PRG006)
Tekshiruvchi:Mirzayeva Gulmira
1-topshiriq
#include
#include
using namespace std;
int main()
{
char arr[] = "Katta harflarda chiqarib ber.";
cout << "Original String:\n"<< arr<< endl;
cout<<"String in UPPERCASE:\n";
for (int x=0; x
putchar(toupper(arr[x]));
return 0;
}
2-topshiriq
#include
#include
using namespace std;
int main() {
char str[100];
cout << "Belgilar qatorini kiriting: ";
cin.getline(str, 100);
int length = strlen(str);
char *token = strtok(str, " ");
char result[100] = "";
while (token != NULL) {
if (strlen(token) % 2 != 0) {
strcat(result, token);
strcat(result, " ");
}
token = strtok(NULL, " ");
}
cout << "Natija: " << result << endl;
return 0;
}
3-topshiriq
#include
#include
#include
#include
using namespace std;
bool isPrime(int n) {
if (n <= 1) {
return false;
}
int sqrtN = sqrt(n);
for (int i = 2; i <= sqrtN; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
int main() {
string A = "Salom barchaga ushbu dastur C++ da yozilgan";
string B = "";
stringstream ss(A);
string word;
while (ss >> word) {
if (isPrime(word.length())) {
B += word + " ";
}
}
cout << "B satr: " << B << endl;
return 0;
}
|
| |