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

ممكن تساعدوني في حل هذا السؤال

مغلق
بدأه شجونة في 21 أكتوبر 2005 · 1 رد · 393 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

هذا السؤال صعب شوي

ساعدوني بليز :(

في سي ++

Input an integer containing only 0s &1s (i.e., a "binary" integer) & print its decimal equivalent. Use the modulus & division operators to pick off the "binary" number’s digits one at a time from right to left . Much like in the decimal number system , where the rightmost digit has a positional value of 1 , the next digit left has a positional value of 10,then 100, then1000,and so on in the binary number system , the rightmost digit has a positional value of 1, the next digit left has a positional value of2 ,then4,then8,and so on . Thus the decimal number 234 can be interpreted as 4*1+3*10+2*100. Then decimal equivalent of binary 1101 is 1*1+0*2+1*4+1*8 or 1+0+4+8, or 13

يالله ابي مساعدة بسرعة :(

تم تعديل هذه المشاركة بواسطة شجونة في 21 أكتوبر 2005 في 23:41

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

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