نصائح و استشارات برمجية
1.45K subscribers
546 photos
10 videos
83 files
398 links
• نصائح واستشارات برمجية متعلقة باسئلة تم طرحها

• لطرح استفسار او سؤال: @m4md24
Download Telegram
نصائح و استشارات برمجية
انهي احسن
اختار Asus بس اعمل حسابك انك لازم تغير الـ hard disk و تجيبه من نوع SSD
و تزود الـ ram تخليها 8 جيجا
This media is not supported in your browser
VIEW IN TELEGRAM
بدي vpn مجاني وما يطلب اشتراك للكمبيوتر
كل ما احمل vpn يشتغل اول شي تمام بعد كم يوم بيصير النت بطيئ كتير وبيطلب اشتراك vib
This media is not supported in your browser
VIEW IN TELEGRAM
نصائح و استشارات برمجية
https://codeforces.com/problemset/problem/510/A
#include <iostream>
using namespace std;

int main() {
int n, m;
cin >> n >> m;

for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
if (i % 2 == 1) {
cout << "#";
} else {
if ((i / 2) % 2 == 1 && j == m) {
cout << "#";
} else if ((i / 2) % 2 == 0 && j == 1) {
cout << "#";
} else {
cout << ".";
}
}
}
cout << endl;
}

return 0;
}
This media is not supported in your browser
VIEW IN TELEGRAM
السلام عليكم لماذا لا تستعينون بذكاء الاصطناعي في حل مشاكلكم خاصة الاكواد
نصائح و استشارات برمجية
السلام عليكم لماذا لا تستعينون بذكاء الاصطناعي في حل مشاكلكم خاصة الاكواد
• و عليكم السلام و رحمة الله و بركاته، بالعكس اللي مش بيستعين بيها حتى لو خبير .. بتكون خبراته اقل سرعة و انتاجيته اقل من اللي بيستخدمها.
This media is not supported in your browser
VIEW IN TELEGRAM
طيب يا جماعه انا بأمانه محبط جدا انا بقالي اسبوعين عمال احاول افهم ال function و بحل ال homework بتاعها و في حاجات كام مسأله مش عارف احلهم ولا فاهم احلهم ازاي مش عارف ده طبيعي ولا المشكله فيا ولا فالشرح ولا المسائل هي الي كبيره على مسوايا ولا ايه لو حد يقدر يساعدني يا شباب ياريت يتفضل لأني بصراحه حالتي النفسية فالنازل خالص بسبب الموضوع ده
نصائح و استشارات برمجية
طيب يا جماعه انا بأمانه محبط جدا انا بقالي اسبوعين عمال احاول افهم ال function و بحل ال homework بتاعها و في حاجات كام مسأله مش عارف احلهم ولا فاهم احلهم ازاي مش عارف ده طبيعي ولا المشكله فيا ولا فالشرح ولا المسائل هي الي كبيره على مسوايا ولا ايه لو حد يقدر…
• يا غالي خد الامور ببساطة، عادي خالص اللي بيحصلك بيحصل لناس كتير 💚 .. الدوال كل ما فيها اننا بنستخدمها عشان نكتب جواها اكواد معينة بتساعدنا نعمل مهمة .. و بعدين نستدعيها في الدالة الرئيسية اللي بتنفذ جميع الاكواد اللي جواها و بنستخدمها بالشكل اللي قولتهولك عشان ننظم الاكواد و الكود وقتها ينفع يتقري 🤝🏻💚
This media is not supported in your browser
VIEW IN TELEGRAM
لوسمحت اريد حل للبرنامج بلغة #c

Create a new class for employees as shown in class diagram:
Help:
- Print message on the screen by calling Choices function that promote user to enter one of these choices:
[ 1: Display 2: Display All 3: Add 4: Delete 5: Delete All 7- Exit].
- Calling a function depend on the choice!
- Until the choice not equal 5 ask user for enter a choice by showing the previous message.
- Define array for employees with size of 8.
- EmpCounter must be one copy for all instances.
- ReturnData( int id) used for print data of employee with id and must be called inside the body of Display(int id), DisplayAll( ).
- Display( ) used to get employee id from user and then display data by calling ReturnData(int id).
- IsEmpty( int x) used to check if the array at index x is empty or not and return Boolean value.
- DisplayAll( ) retrieve count of employees with no empty data and then return all employees data using foreach.
- SearchByName( ) search for a specific employee with his name.

Employee
+ EmpID: int
+ EmpNumber: int
+-NaitionalityID: int
+ EmpName: string
+ Gender: bool
- Email: string
+ Age: int
+ Specialist: string
+ DeptNum: int
- EmpCounter:int
+ Choices( ):void
- ReturnData(int):Employee
+ Display( ):void
+ Display(int):void
+ Delete( ):void
+ Delete(int):void
+ Add( ):void
+ DisplayAll( ):void
+ DeleteAll( ):void
- IsEmpty(int):bool
+ SearchByName(int):void
نصائح و استشارات برمجية
لوسمحت اريد حل للبرنامج بلغة #c Create a new class for employees as shown in class diagram: Help: - Print message on the screen by calling Choices function that promote user to enter one of these choices: [ 1: Display 2: Display All 3: Add…
using System;

class Employee
{
private static int EmpCounter = 0;
private static Employee[] employees = new Employee[8];

public int EmpID { get; set; }
public int EmpNumber { get; set; }
public int NationalityID { get; set; }
public string EmpName { get; set; }
public bool Gender { get; set; }
public string Email { get; set; }
public int Age { get; set; }
public string Specialist { get; set; }
public int DeptNum { get; set; }

public static void Choices()
{
int choice;
do
{
Console.WriteLine("Enter your choice:");
Console.WriteLine("1: Display 2: Display All 3: Add 4: Delete 5: Delete All 6: Exit");
choice = int.Parse(Console.ReadLine());

switch (choice)
{
case 1:
Console.WriteLine("Enter employee ID:");
int id = int.Parse(Console.ReadLine());
Display(id);
break;
case 2:
DisplayAll();
break;
case 3:
Add();
break;
case 4:
Console.WriteLine("Enter employee ID to delete:");
int deleteId = int.Parse(Console.ReadLine());
Delete(deleteId);
break;
case 5:
DeleteAll();
break;
case 6:
Environment.Exit(0);
break;
default:
Console.WriteLine("Invalid choice. Please try again.");
break;
}
} while (choice != 6);
}

public static void Display(int id)
{
Employee employee = ReturnData(id);
if (employee != null)
{
Console.WriteLine($"Employee ID: {employee.EmpID}");
Console.WriteLine($"Employee Number: {employee.EmpNumber}");
Console.WriteLine($"Employee Name: {employee.EmpName}");
}
else
{
Console.WriteLine("Employee not found.");
}
}

public static Employee ReturnData(int id)
{
foreach (Employee emp in employees)
{
if (emp != null && emp.EmpID == id)
{
return emp;
}
}
return null;
}

public static void DisplayAll()
{
Console.WriteLine("Employee List:");
foreach (Employee emp in employees)
{
if (emp != null)
{
Console.WriteLine($"Employee ID: {emp.EmpID}");
Console.WriteLine($"Employee Name: {emp.EmpName}");
}
}
}

public static void Add()
{
if (EmpCounter < employees.Length)
{
Employee employee = new Employee();
Console.WriteLine("Enter employee ID:");
employee.EmpID = int.Parse(Console.ReadLine());
Console.WriteLine("Enter employee Number:");
employee.EmpNumber = int.Parse(Console.ReadLine());
Console.WriteLine("Enter employee Name:");
employee.EmpName = Console.ReadLine();
employees[EmpCounter++] = employee;
Console.WriteLine("Employee added successfully.");
}
else
{
Console.WriteLine("Employee list is full. Cannot add more employees.");
}
}

public static void Delete(int id)
{
for (int i = 0; i < employees.Length; i++)
{
if (employees[i] != null && employees[i].EmpID == id)
{
employees[i] = null;
EmpCounter--;
Console.WriteLine("Employee deleted successfully.");
return;
}
}
Console.WriteLine("Employee not found.");
}
نصائح و استشارات برمجية
لوسمحت اريد حل للبرنامج بلغة #c Create a new class for employees as shown in class diagram: Help: - Print message on the screen by calling Choices function that promote user to enter one of these choices: [ 1: Display 2: Display All 3: Add…
public static void DeleteAll()
{
for (int i = 0; i < employees.Length; i++)
{
employees[i] = null;
}
EmpCounter = 0;
Console.WriteLine("All employees deleted successfully.");
}

public bool IsEmpty(int x)
{
return employees[x] == null;
}

public static void SearchByName(string name)
{
foreach (Employee emp in employees)
{
if (emp != null && emp.EmpName == name)
{
Console.WriteLine($"Employee ID: {emp.EmpID}");
Console.WriteLine($"Employee Name: {emp.EmpName}");
}
}
}
}
This media is not supported in your browser
VIEW IN TELEGRAM
نصائح و استشارات برمجية
https://codeforces.com/problemset/problem/1352/A
#include <iostream>
#include <vector>

using namespace std;

int main() {
int t;
cin >> t;

while (t--) {
int n;
cin >> n;

vector<int> roundNumbers; // Store the round numbers for this test case

int multiplier = 1; // To extract digits from n
while (n > 0) {
int digit = n % 10;
if (digit != 0) {
roundNumbers.push_back(digit * multiplier);
}
n /= 10;
multiplier *= 10;
}

cout << roundNumbers.size() << endl;
for (int i = 0; i < roundNumbers.size(); ++i) {
cout << roundNumbers[i] << " ";
}
cout << endl;
}

return 0;
}
This media is not supported in your browser
VIEW IN TELEGRAM