cookie

Utilizamos cookies para mejorar tu experiencia de navegación. Al hacer clic en "Aceptar todo", aceptas el uso de cookies.

avatar

Dasturlash💻

C++ PHP Python C sharp(C#) Java script

Mostrar más
Publicaciones publicitarias
42
Suscriptores
Sin datos24 horas
Sin datos7 días
Sin datos30 días

Carga de datos en curso...

Tasa de crecimiento de suscriptores

Carga de datos en curso...

04:33
Video unavailableShow in Telegram
1=5 😅🤓
Mostrar todo...
#include <iostream> #include <vector> using namespace std; vector<vector<int>> createMatrix(int m, int n, int sum) {     vector<vector<int>> matrix(m, vector<int>(n, 0)); // m x n o'lchamli matritsa yaratish         int totalSum = 0;     for (int i = 0; i < m; i++) {         for (int j = 0; j < n; j++) {             if (totalSum < sum) {                 matrix[i][j] = 1; // Matritsani kiritilgan m ta sondan to'ldirish                 totalSum += 1;             } else {                 break; // Sondan to'ldirish amalini tugatish             }         }     }         return matrix; } void printMatrix(const vector<vector<int>>& matrix) {     int m = matrix.size();     int n = matrix[0].size();         for (int i = 0; i < m; i++) {         for (int j = 0; j < n; j++) {             cout << matrix[i][j] << " ";         }         cout << endl;     } } int main() {     int m, n, sum;     cout << "m ni kiriting: ";     cin >> m;     cout << "n ni kiriting: ";     cin >> n;     cout << "Butun sonlarning yig'indisini kiriting: ";     cin >> sum;         vector<vector<int>> matrix = createMatrix(m, n, sum);         cout << "Natija:" << endl;     printMatrix(matrix);         return 0; }
Mostrar todo...
Photo unavailableShow in Telegram
5.3
Mostrar todo...
#include <iostream> #include <fstream> #include <string> struct Book { std::string title; std::string author; int year; }; int main() { const int MAX_BOOKS = 100; // Maksimal kitoblar soni Book books[MAX_BOOKS]; int bookCount = 0; std::ifstream inputFile("kitoblar.txt"); if (!inputFile) { std::cerr << "Faylni ochishda xatolik yuz berdi." << std::endl; return 1; } std::string title, author; int year; while (inputFile >> title >> author >> year) { if (year == 2012) { if (bookCount < MAX_BOOKS) { books[bookCount].title = title; books[bookCount].author = author; books[bookCount].year = year; bookCount++; } else { std::cerr << "Maksimal kitoblar soni belgilangan oshdi." << std::endl; break; } } } inputFile.close(); for (int i = 0; i < bookCount; i++) { std::cout << "Kitob nomi: " << books[i].title << std::endl; std::cout << "Muallifi: " << books[i].author << std::endl; std::cout << "Chop etilgan yili: " << books[i].year << std::endl; std::cout << std::endl; } return 0; }
Mostrar todo...
Photo unavailableShow in Telegram
4.3
Mostrar todo...
#include <iostream> #include <vector> struct Employee { std::string name; int age; }; int main() { std::vector<Employee> employees; // Ishchilar ro'yxatiga ma'lumotlarni kiritish Employee emp1; emp1.name = "John"; emp1.age = 20; employees.push_back(emp1); Employee emp2; emp2.name = "Emma"; emp2.age = 21; employees.push_back(emp2); Employee emp3; emp3.name = "Michael"; emp3.age = 19; employees.push_back(emp3); // 21 yoshdan kichik bo'lgan ishchilarni chiqarish for (const auto& emp : employees) { if (emp.age < 21) { std::cout << "Ism: " << emp.name << ", Yosh: " << emp.age << std::endl; } } return 0; }
Mostrar todo...
Photo unavailableShow in Telegram
3.3
Mostrar todo...
#include <iostream> int main() {     int n;     std::cout << "Son kiriting (1 < n <= 26): ";     std::cin >> n;     if (n > 0 && n <= 26) {         char letter = 'A';         for (int i = 1; i <= n; i++) {             std::cout << letter << " ";             letter++;         }         std::cout << std::endl;     } else {         std::cout << "Noto'g'ri son kiritildi." << std::endl;     }     return 0; }
Mostrar todo...
Photo unavailableShow in Telegram
2.3
Mostrar todo...