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

[مخالف]هل هنالك أح

مغلق
بدأه mohammednoor في 5 مايو 2012 · 2 رد · 196 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع
اقتباس
هل هذا الكود يصلح لهذا السؤال

إخواني في هذا السؤال طالب design التصميم للكود أنا قريت عن هذا الموضوع في أحد المنتديات يقولوا عند وجود for نستبدلها ب loop for ولا أعرف ماتكملة العملية أرجو المساعدة مع الشكر

Write a program to input a three integer numbers, each of them is between 1 and 1000, and determine whether the first number is the multiple of the other two numbers. Print a message to tell if the first number is the multiple of the other two numbers.

#include <vcl.h>
#include <iostream>
#include <stdlib.h>
using namespace std;
#pragma hdrstop

//---------------------------------------------------------------------------

#pragma argsused

int main()
{
    int x, y, z;
    cout << "\nplease enter the numbers: ";
    cin >> x >> y >> z;
    while (x < 1 || x > 1000)
    {
        cout << "\nplease enter the first number should between 1-1000 : ";
        cin >> x;
    }
    while (y < 1 || y > 1000)
    {
        cout << "\nenter the second number:  ";
        cin >> y;
    }
    while (z < 1 || z > 1000)
    {
        cout << "\nenter the third number: ";
        cin >> z;
    }
    if (x == y * z)
        cout << "\nthe first is amulet of the second and third: ";
    else
        cout << "\nthe number is not correct: ";
     getchar();
    system("pause");
    return 0;
}


//---------------------------------------------------------------------------

وهذا السؤال هل هذا الكود صحيح لهذا السؤال

اقتباس

Consider a 5-by-5 array of characters. Write a C++ program to accomplish each of the following operations:

a. Declare the above array.

b. Read the array.

c. Find and print the number of vowels (a,e,o) in the off diagonal of the array.

d. Replace each non-space character in the array by its next character value in the alphabetic order (Example: letter b will be replaced by c, letter M will be replaced by N, and so on).

#include <vcl.h>
#include <iostream>
using namespace std;

int main()
{
    int counter = 0;
    char array[5][5];


    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 5; j++)
            cin >> array[j];
    }


    for (int i = 0; i < 5; i++)
    {
        int j=0;
        for ( j = 0; j < 5; j++)
        {
            if ( j == 4)
            {
                if (array[j] == 'a' || array[j] == 'e' || array[j] == 'o')
                    counter++;
            }
        }
    }


    for (int i = 0; i < 5; i++)
    {
        for (int j = 0; j < 5; j++)
        {
            if (array[j] != ' ')

                array[j]++;


               cout << array[j];
        }

    }

    getchar();
    return 0;

}
//---------

أسف بالغلط مانكتب الموضوع صح

الموضوع هو هل هنالك أخطاء في الأكواد هذه

−1
#2

أخى الفاضل انا اعتب عليك

أعذرنى يبدو انك لم ترى مشاركتك بالامس وهى نفس السؤال الثانى

واتمت كتابة الكود لها ومختبر بالمدخلات والمخرجات

أخى حاول الا تضيع وقتك ووقتنا فى تكرار الحلول

حل السؤال الثانى من هنا

وفقنى الله واياك لخدمة المسلمين

post-15367-027053900%201340345097.gifpost-15367-087183200%201340344597.gif
post-247365-0-10080400-1379403554_thumb.

#3

الأخ الكريم/الأخت الكريمة

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

مرحباً بكم في منتدى الفريق العربي للبرمجة

تأسف إدارة المنتدى لغلق الموضوع وذلك لمخالفته قوانين المشاركات .

قواعد طرح المشاركات

/index.php?showtopic=29343

شاكرين لكم حُسن تعاونكم

{username}

مدونتي: C++ Tips and Tricks

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

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