简体中文
Telegram

讨论串 消息 #29809

16 条消息 · –
        1. M
          Harakat qb koʻrdm . Internettanam qarabam koʻrdm oʻxshamadi
        1. M
          Tasodifiy n sonli stekni to‘ldiring va shu stekdagi birinchi manfiy elementlarni toping.
          1. 已
            #include <iostream> #include <stack> #include <time.h> #include <cctype> using namespace std; int main() { srand(time(0)); stack<int> s; int n; cout << "Enter the number of elements: "; cin >> n; // Stacking the elements for(int i=0; i<n; i++){ int element; cout << "Enter element " << i+1 << ": "; element=rand()%100; s.push(element); } // Finding the first negative element while(!s.empty()){ int element = s.top(); s.pop(); if(element < 0){ cout << "The first negative element is: " << element << endl; return 0; } } cout << "There is no negative element in the stack" << endl; return 0; }
            1. M
              Qaren bunisida tasodifiy sonla bilan dvottiku ushanga random qilib ishlanishi kerakmasmi.
        2. M
          Valarray sinfidan foydalanib, massivning barcha elementlari uchun dekrementini (prefiks (--i) va postfiks (i--) lar uchun) amalga oshiring
          1. 已
            #include <iostream> #include <valarray> using namespace std; int main() { valarray<int> arr = {1, 2, 3, 4, 5}; // Dekrementation using prefix (--i) cout << "Prefix decrementation: "; for(int i=0; i<arr.size(); i++){ cout << --arr[i] << " "; } cout << endl; // Resetting array to original values arr = {1, 2, 3, 4, 5}; // Dekrementation using postfix (i--) cout << "Postfix decrementation: "; for(int i=0; i<arr.size(); i++){ cout << arr[i]-- << " "; } cout << endl; return 0; }

来自搜索索引的公开信息流 ChatCrawler ——“公开 Telegram 的 Google”;随着该社群被抓取而更新。 时间为 UTC。

仅限公开内容,使用 Telegram 官方 API。 关于 · 常见问题 · 索引限制 · 移除页面 · 目录 · 搜索 · 计算方法