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

• لطرح استفسار او سؤال: @m4md24
Download Telegram
السلام عليكم
لو حد عارف الفرق بين المتغير المحلي والغير محلي في لغة كوتلن ياريت يوضح
This media is not supported in your browser
VIEW IN TELEGRAM
طيب انا حاليا خلصت basic of kotlin وماشي حاليا في ال OOP هل في مواقع بتقدم افكار ممكن نقدمها او أي طريقه عموما اتدرب بيها على الحاجات اللي بتعلمها ؟
●هتلاقي عند اسماء المواقع دي مسائل تقدر ان شاء الله تحلها ⬇️💚:

• Codeforces

• LeetCode

• HackerRank

• TopCoder

• AtCoder

• HackerEarth

• Codewars
This media is not supported in your browser
VIEW IN TELEGRAM
لوسمحت عطني كود برنامج يقوم بإدخال عددين وطباعه العامل المشترك الاكبر
+برنامج يقوم بإدخال عددين وطباعه المضاعف المشترك الأصغر
نصائح و استشارات برمجية
لوسمحت عطني كود برنامج يقوم بإدخال عددين وطباعه العامل المشترك الاكبر
#include <iostream>
using namespace std;

int main() {
int num1, num2;

cout << "Enter first number: ";
cin >> num1;

cout << "Enter second number: ";
cin >> num2;

int gcd = 1;
for (int i = 1; i <= num1 && i <= num2; i++) {
if (num1 % i == 0 && num2 % i == 0) {
gcd = i;
}
}

cout << "Greatest Common Divisor: " << gcd << endl;

return 0;
}
نصائح و استشارات برمجية
+برنامج يقوم بإدخال عددين وطباعه المضاعف المشترك الأصغر
#include <iostream>
using namespace std;

int main() {
int num1, num2;

cout << "Enter first number: ";
cin >> num1;

cout << "Enter second number: ";
cin >> num2;

int lcm = (num1 > num2) ? num1 : num2;

while (true) {
if (lcm % num1 == 0 && lcm % num2 == 0) {
cout << "Least Common Multiple: " << lcm << endl;
break;
}
lcm++;
}

return 0;
}
This media is not supported in your browser
VIEW IN TELEGRAM
#include <iostream>
using namespace std;
struct pool{
int data;
pool*next;
};
pool*head=NULL;
void insertion(int value)
{
pool*first,*last;
first=new pool;
first->data=value;
if(head==NULL){head=first;first->next=NULL;}
else{
head=last;
while(last->next!=NULL)
{
last=last->next;
}
last->next=first;
first->next=NULL;
}
void display(){

pool*cptr;
if(head==NULL)
{
cout<<"linked list is empty . ";
}
else{
cptr=head;
while(cptr!=NULL)
{
cout<<cptr->data<<"\t\n\t";
cptr=cptr->next;
}
}
}

}

int main()
{

insertion(10);
insertion(20);
insertion(30);
insertion(40);
insertion(50);
display();
return 0 ;
}
نصائح و استشارات برمجية
#include <iostream> using namespace std; struct pool{ int data; pool*next; }; pool*head=NULL; void insertion(int value) { pool*first,*last; first=new pool; first->data=value; if(head==NULL){head=first;first->next=NULL;} else{ head=last;…
• دا التصحيح ↓
#include <iostream>

using namespace std;

struct pool {
int data;
pool *next;
};

pool *head = NULL;

void insertion(int value) {
pool *first, *last;
first = new pool;
first->data = value;
if (head == NULL) {
head = first;
first->next = NULL;
} else {
last = head;
while (last->next != NULL) {
last = last->next;
}
last->next = first;
first->next = NULL;
}
}

void display() {
pool *cptr;
if (head == NULL) {
cout << "linked list is empty . ";
} else {
cptr = head;
while (cptr != NULL) {
cout << cptr->data << "\n";
cptr = cptr->next;
}
}
}

int main() {
insertion(10);
insertion(20);
insertion(30);
insertion(40);
insertion(50);
display();
return 0;
}
This media is not supported in your browser
VIEW IN TELEGRAM
يا جماعة ععندي برنامج كاتبه بسويتش هل ينفع داخل السويتش احط شرط؟
This media is not supported in your browser
VIEW IN TELEGRAM
ده عملتوه وطلع غلط
نصائح و استشارات برمجية
ده عملتوه وطلع غلط
مينفعش يكون في مسافات بين كل كلمة في اسم المتغير، و يفضل انك تةخديها قاعدة في البرمجة تجنباً للاخطاء
سطر ٧ و ٨ و ٩ و ١٠ و ١١ و ١٢