قسم هندسة الحاسب الالي
Відкрити в Telegram
قنـاة خاصة بالاسئلة للقسم https://t.me/computer2004ra1
Показати більше1 298
Підписники
+224 години
+97 днів
+1030 день
Архів дописів
السلام عليكم
نبوا حد منزل كيمياء معمل لو عنده معلومه ان هل المنسقه نفسها وهل نقروا من نفس الشيت متع 18 الصفحه او لا
فيديو مليح لشرح نهاية شابتر 4
https://www.youtube.com/watch?v=wE0_F4LpGVc
كود ال bubble sort
#include <stdio.h>
// perform the bubble sort
void bubbleSort(int array[], int size) {
// loop to access each array element
for (int step = 0; step < size - 1; ++step) {
// loop to compare array elements
for (int i = 0; i < size - step - 1; ++i) {
// compare two adjacent elements
// change > to < to sort in descending order
if (array[i] > array[i + 1]) {
// swapping occurs if elements
// are not in the intended order
int temp = array[i];
array[i] = array[i + 1];
array[i + 1] = temp;
}
}
}
}
// print array
void printArray(int array[], int size) {
for (int i = 0; i < size; ++i) {
printf("%d ", array[i]);
}
printf("\n");
}
int main() {
int data[] = {-2, 45, 0, 11, -9};
// find the array's length
int size = sizeof(data) / sizeof(data[0]);
bubbleSort(data, size);
printf("Sorted Array in Ascending Order:\n");
printArray(data, size);
}
https://www.youtube.com/watch?v=spZd2rNtze8
فيديو مليح تفهم منه ال Templates
سؤال المسابقة:
https://www.codewars.com/kata/521c2db8ddc89b9b7a0000c1/train/python
الحل:
def snail(array):
ret = []
if array and array[0]:
size = len(array)
for n in xrange((size + 1) // 2):
for x in xrange(n, size - n):
ret.append(array[n][x])
for y in xrange(1 + n, size - n):
ret.append(array[y][-1 - n])
for x in xrange(2 + n, size - n + 1):
ret.append(array[-1 - n][-x])
for y in xrange(2 + n, size - n):
ret.append(array[-y][n])
return ret
حل تاني أقصر:
import numpy as np
def snail(array):
m = []
array = np.array(array)
while len(array) > 0:
m += array[0].tolist()
array = np.rot90(array[1:])
return m
برنامج لتعداد مرات حصول زيادة لسلسلة أرقام
#include <iostream>
using namespace std;
int main()
{
int arr[] = {30, 15, 36, 21, 48, 60};
int len = sizeof(arr) / sizeof(arr[0]);
int counter = 0;
int prev = 0;
for(int i = 0; i < len; i++){
if(arr[i] > prev){
counter++;
prev = arr[i];
}
}
cout<< counter;
}
#include <iostream>
using namespace std;
int* rotation(int arr[], int steps);
int main()
{
int a[] = {1,2,3,4,5,6};
rotation(a,2);
}
int* rotation(int arr[], int steps){
int newArr[6];
int count1 = 0, count2 = 6 - steps;
for(;count1<steps;){
newArr[count2++] = arr[count1++];
}
count2 = 0;
for(;count1<6;){
newArr[count2++] = arr[count1++];
}
for(int i = 0; i<6; i++){
cout<< newArr[i];
}
return newArr;
};
overloading >>, <<
https://youtu.be/2972LRdyquk?si=GUoYGTf2IJC4uqad
#EC252
دعواتكم بالشفاء العاجل لزميلنا محمد خلف كيف طلع من غرفة العمليات ان شاء الله ينوض بالسلامة.
تذكير بموعد امتحان السي
الساعة : 11 (مدرج الهندسة 2)
#EC251
موفقين جميعاً
مُطالبين بـ3 طرق بس لاستخدام الـString في الـc++
(Using pointers, Using an array of char, and using String type)
https://www.geeksforgeeks.org/array-of-strings-in-cpp-5-different-ways-to-create/
#EC252
Вже доступно! Дослідження Telegram за 2025 — головні інсайти року 
