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

محمد زين الدين

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

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

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

أجوبة بواسطة محمد زين الدين

  1. بتاريخ الآن قال Mohammed Saber:
    
    /******************************************************************************
    
                                  Online C++ Compiler.
                   Code, Compile, Run and Debug C++ program online.
    Write your code in this editor and press "Run" button to compile and execute it.
    
    *******************************************************************************/
    
    #include <iostream>
    
    using namespace std;
    
    void starPattern() 
    { 
    
        for (int i = 0; i < 5; i++) { 
      
            for (int j = 0; j < 4; j++) {
                if(i == 2 ) {
                  cout << "*";
                } else {
                  if(j == 1 || j == 2) {
                    cout << " ";
                  } else {
                    cout << "*";
                  }
                }
            } 
      
            // Ending line after each row 
            cout << endl; 
        } 
    }
    
    int main() 
    { 
    
        starPattern(); 
        return 0; 
    } 

     

    شكرا جزيلا غلبتك معي

  2. بتاريخ الآن قال Mohammed Saber:

    مرحباً محمد إليك الكود بلغة جافاسكربت 
     

    
    for(let i =0; i <5; i++ ) {
      for(let j=0; j < 4; j++) {
        if(i === 2 ) {
          document.write('*')
        } else {
          if(j === 1 || j === 2) {
            document.write('&nbsp;&nbsp;');
          } else {
            document.write('*')
          }
        }
        
      }
      document.write('<br />');
    }

    هذا هو  الكود 

    اشكرك صديقي لكن اوريده على ++ c

     

×
×
  • أضف...