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

سؤال عاجل

مغلق
بدأه Andromeda في 25 مارس 2006 · 3 رد · 456 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع
#include<iostream.h>
int main()
{char c;
	char*name[20];
	for(int i=0;i<20;i++)
	{ for(int j=0;*(name+j)!='\0';j++)
     cin>>*(name+j);
	if(*(name+j)=='9')
    break;
}
	for(int s=0;s<20;s++)
	{for(int y=0;y<20;y++)
  cin>>c;
if(*(name+y)==c)
cout<<*(name+s);}}

السلام عليكم اجمعين

عندي هذا السؤال المفروض انه يخلي اليوزر يكتب اسماء واذا اليوزر دخل رقم 9 يطلب البرنامج من اليوزر انه يعطيه حرف واذا اليوزر عطى الحرف البرنامج يكتب الى اليوزر كل الاسماء الي تبدء بهذا الحرف........ حليت السؤال لكن مو عارفه شنو الغلط الي فيه...وبكرة لازم اسلمه :(

#2

#include <iostream>

#include <string>

using namespace std;

void main()

{

char x;

string name[20];

for(int i=0;i<20;i++)

{

cin>>name;

if(name=="9")

break;

}

cout<<"enter: ";

cin>>x;

for(int j=0;j<i;j++)

{

if(x==name[j].at(0))

cout<<name[j]<<endl;

}

}

هذا الكود بال c++ ترجم للc و سلم ;)

ENG. IMAD, Programing is a way of life, It's in the air, we breath It's pumps through our veines, Without it, we soon crumble to dust

#3

شكرا على الرد ماقصرت لكن حنا يبغون الاسايمنت مالنه بدون cstring على العموم انا وابعد جهد جهيد

حليت الproblem وهذا جوابه بدون function cstring ;)

#include<iostream>
using namespace std;
void main(){

	char k;

	char cont=0;

	const int size=500;

	char *arr[size];
	char names[size][size];

	for(int n=0;n<size;n++)
  arr[n]= &names[n][0];

	do{
  cout<<"Enter students names:";
  cin>>*(arr+cont);
  cont++;
	}while (**(arr+cont-1) !='9');

	cout<<" please Enter  your key:";
	cin>>k;

	for(int z=0;z<size;z++)
  
	if(k==**(arr+z))
	cout<<*(arr+z)<<endl;
}
#4

تمام فانت استخدمت ال MULTIDIMENTIONAL ARRAY فهي تتيح لك ان تدخل اكثر من كلمه لاكثر من حرف

ENG. IMAD, Programing is a way of life, It's in the air, we breath It's pumps through our veines, Without it, we soon crumble to dust

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

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