الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

ساااااااااااااااااعدوني بسرعه لو سمحتم

مغلق
بدأه سلامه في 6 مايو 2003 · 5 رد · 707 مشاهدة · في JavaSE
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

:'(السلام عليكم

هلا

انا اواجه مشكله

في هذا الكود اريد أطلع أكبر قيمتين و أنا الحين طلعت أكبر قيمه

ممكن المساعده

import javax.swing.*;

public class problem3 {

public static void main(String ar[])

{

int array[]={3,5,8,9,18,4,33,67,4,77};

int index = max(array);

JOptionPane.showMessageDialog(null,"the max number is"+index);

}

public static int max(int a[])

{int maxnumber = 0;

for(int x=0; x

{

if (maxnumber < a[x] ) maxnumber=a[x];

}

return maxnumber;

}

}

#2

لو سمحتم ممكن أحد يساعدني

#3

ان شاء الله نقدر نساعدك

public class problem3 {

public static void main(String ar[])
{

int array[]={3,5,8,9,18,4,33,67,4,77};

int index = max(array);
int max2=array[0];
for(int i=0;i
if(array>max2 && arraymax2=array ;
JOptionPane.showMessageDialog(null,"the max number is"+index+ "the second max number is" +max2);
}
public static int max(int a[])
{int maxnumber = 0;
for(int x=0; x{
if (maxnumber < a[x] ) maxnumber=a[x];

}
return maxnumber;
}

}

جرّب هذه الطريقة واذا لم تحل المشكلة أرسل لنا مرة أخرى

وفق الله الجميع لما يحبه ويرضاه ..............

#4

السلااااااااااام عليكم ورحمة الله وبركاته

شكرا لك اختي طالبة علم2

على تعاونك معي

و مشكوره وااااااااااااايد وااااااااااااااااااااايد

(gift)

#5

السلام عليكم ورحمة الله اسف للتاخير

هذا الكود صحيح ان شاء الله


public static void main(String[] args)
{int temp;
int numbers[]={3,10,5,4,6,7,8,9,1,2,0};
int asend[]=new int[numbers.length];
for(int i=0;i {
asend=numbers;
}
for(int i=0;i {
for(int j=i+1;j {if(asend>asend[j])
{ temp=asend;
asend=asend[j];
asend[j]=temp;
}}
}


System.out.println("the first max = "+asend[asend.length-1]+"t the second max = "+asend[asend.length-2]+"tthe third max = "+asend[asend.length-3] );
System.out.println("nthe first min = "+asend[0]+"t the second min = "+asend[1]+"tthe third min = "+asend[2] );

}
}
class arrays {

لو اى استفسار انا تحت امر حضرتك

اخوك حسام

#6

مشكور اخويه على الرد(gift)

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…