نصائح و استشارات برمجية
Відкрити в Telegram
• نصائح واستشارات برمجية متعلقة باسئلة تم طرحها • لطرح استفسار او سؤال: @m4md24
Показати більше1 445
Підписники
Немає даних24 години
+37 днів
+130 день
Архів дописів
• انه يعتبر استعمال، و اغلبه مش مضمون لان عيوبه كتيرة خصوصا عيوب التصنيع .. حتى لو ملقيتش فيه عيب بعد اول او تاني اسبوع ممكن تلاقي بعد فترة بعيدة شوية.
• دا كل ما في الامر، ولو لقيت حاجة مضمونه 100% يبقى تمام .. لان دا نادر
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int a, b;
cin >> a >> b;
int diff = abs(a - b);
int moves = diff / 10;
if (diff % 10 != 0) {
moves++;
}
cout << moves << endl;
}
return 0;
}
Repost from برمجة
/*
• افضل طريقة للتحقق من اصدار التطبيق بواسطة ⬇️💙:
Firebase Remote Config
#تحفة_برمجية 💙
#اندرويد_Native 💙
*/
اه طبعا، بس دا ميمنعش انه لازم تتعب برضو عشان تغير مجالك و تتاسس بشكل نقدر نقول انه كدا انت شخص فاهم فيه
يا رجالة هو لو مثلا دخلت مجال معين هعرف بعد كدة اعمل شيفت لمجال تاني بسهولة لو انا متاسس كويس ولا لا
#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;
}
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}");
}
}
}
}
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.");
}
Вже доступно! Дослідження Telegram за 2025 — головні інсайти року 
