اذهب إلى المحتوى

moh am

الأعضاء
  • المساهمات

    10
  • تاريخ الانضمام

  • تاريخ آخر زيارة

آخر الزوار

523 زيارة للملف الشخصي

إنجازات moh am

عضو مساهم

عضو مساهم (2/3)

6

السمعة بالموقع

  1. هذا الكود الخاص بي هل اجد احد يساعدني بتعديل الكود لعمل بشكل صحيح وايجاد run المطلوب #include <stdio.h> int main() { int n, i, count = 0; float price, total = 0, discount = 0, max_discount = 0; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%f", &price); total += price; } switch(n) { case 1: case 2: if(total < 20) discount = 0; else discount = total * 0.1; break; default: if(total < 20) discount = total * 0.07; else { discount = total * 0.15; if(discount > total * 0.5) discount = total * 0.5; } break; } for(i = 0; i < n; i++) { scanf("%f", &price); if(price > 7) discount += total * 0.01; } printf("%.2f\n", total - discount); return 0; } حيث ان مطلوب بلغة c
  2. هذا ال output الذي يجب ان يظهر في جميع الشرووط هل يوجد احد لمساعدتي ف انا لم اجد حلاً لها
  3. هذا الكود الخاص بي قمت بانشاء جملة if جديدة وحقق لي الشرطين لاكن متلاصقات لا اعلم هل هي طريقه صحيحه ام لا واذا صحيحه كيف استطيع تحقيق كل شرط في سطر حيث استخدمة /n يقوم بطباعتها ايضا علما ان جميع الشروط هذه If the sum of numbers in the first row, the sum of numbers in the second row, the sum of numbers in the third row, the sum of numbers in the first column, the sum of numbers in the second column, the sum of numbers in the third column, the sum of numbers in the first diagonal, and the sum of numbers in the second diagonal are all equal to the same number, print "Awesome Numbers If the sum of numbers in any row is equal to the sum of numbers in any other row, print "Awesome Rows". o If the sum of numbers in any column is equal to the sum of numbers in any other column, print "Awesome Columns". o If the sum of numbers in the first diagonal is equal to the sum of numbers in the second diagonal, print "Awesome Diagonals". o If the sum of numbers in any row is equal to the sum of numbers in any column, print "Awesome Row and Column". o If the sum of numbers in any row is equal to the sum of numbers in any diagonal, print "Awesome Row and Diagonal". o If the sum of numbers in any column is equal to the sum of numbers in any diagonal, print "Awesome Column and Diagonal". • If none of the above is true, do not print anything فهل الخلل في تنفيذ الشروط حيث ان المشكله الاولى انتهت وظهر مشاكل اخرى
  4. لا اعلم ما المشكله فانه لا يطبع بشكل صحيح ربما يحدث خطا ما حيث انني قمت بحذف الشرط الاول تحقق الشرط الثاني وعند وجود الشرط الثاني يتحقق الشرط الاول
  5. مشكلتي هي انه يوجد مصفوف وطرح عليها اسئله حيث ان الشرط الاول تحقق والشرط الثاني لم يتحقق Awesome Diagonals" will be printed because the first and second diagonals have equal sums (9). "Awesome Column and Diagonal" will be printed because the first column and the first diagonal have equal sums (9) بالفعل مشكلتي ليست بامر ال printf حيث في الكود الخاص بي عرف جميع ال vareble فالمصفوفه ولا اعلم لماذا لم يضهر ال output بشرط الثاني
  6. يتحقق معي الشرط الاولAwesome Diagona1s والثاني لا يتحقق المشكله بال output الثاني الاول يتحقق معي
  7. ايضا لدي برمجة في كود c حيث ال output المطلوب مني هو Awesome Diagona1s و Awesome Column and Diagona1 في هذا الكود الذي انشئته ما المشكله وكيف يمكني حلها #include <stdio.h> int main() { int n1, n2, n3, n4, n5, n6, n7, n8, n9; scanf("%d %d %d %d %d %d %d %d %d", &n1, &n2, &n3, &n4, &n5, &n6, &n7, &n8, &n9); int row1 = n1 + n2 + n3; int row2 = n4 + n5 + n6; int row3 = n7 + n8 + n9; int col1 = n1 + n4 + n7; int col2 = n2 + n5 + n8; int col3 = n3 + n6 + n9; int diag1 = n1 + n5 + n9; int diag2 = n3 + n5 + n7; if (row1 == row2 && row2 == row3 && row3 == col1 && col1 == col2 && col2 == col3 && col3 == diag1 && diag1 == diag2) { printf("Awesome Numbers"); } else if (row1 == row2 || row1 == row3 || row2 == row3) { printf("Awesome Rows"); } else if (col1 == col2 || col1 == col3 || col2 == col3) { printf("Awesome Columns"); } else if (diag1 == diag2) { printf("Awesome Diagona1s"); } else if (row1 == col1 || row1 == col2 || row1 == col3 || row1 == diag1 || row1 == diag2 || row2 == col1 || row2 == col2 || row2 == col3 || row2 == diag1 || row2 == diag2 || row3 == col1 || row3 == col2 || row3 == col3 || row3 == diag1 || row3 == diag2){ printf("Awesome Row and Column"); } else if (col1 == diag1 ) { printf("Awesome Column and Diagona1"); } return 0; } حيث ان يتحقق معي الشرط الاولAwesome Diagona1s والثاني لا يتحقق
  8. شكراا لك هل يجب في مشكلتي اضافة Vareble char للرمز m الذي يعبر عن الامتار ام فقط المشكليه هي تحويل من ساعات الى دقائق
  9. السلام عليكم لدي مشكله في برنامج الاوبونتو gedit اذا كان لدي الكود التالي #include <stdio.h> int main() { int time, velocity; scanf("%d %d", &time, &velocity); int distance = time * velocity; printf("%d", distance); return 0; } حيث انه في هذه المشكلة من المفترض أن احدد الرمز المسافة (بالأمتار)واريد كتابة الكود يشمل المعلومات التاليه ستسافر الطائرة إذا سافرت لمدة m دقيقة بسرعة v كم / ثانية (ستكون السرعة عددًا صحيحا) ، ولكنه عند البدء بكتابت الكود اواجهه اكثر من مشكله حيث يحتوي على خطأ منطقي واحد أو أكثر يجعل الإخراج غير صحيح في بعض الحالات. عذذرااا السؤال بلغة c#
  10. I have a question about C programming language in Ubuntu مرحبا اريد شخص يساعدني او يفهني حل هذا السرال واسئله اخرى شكراا
×
×
  • أضف...