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

هذه لعبة بسيطه في لغة سي++ خاصة بعشاق الرياضيات

مغلق
بدأه ayman_ptr في 22 يناير 2007 · 3 رد · 826 مشاهدة · في لغة C و ++C
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

#include<iostream.h>

#include<cstdlib>

void main()

{

int n,a,b,r,t,sum,s,e=0;

unsigned int l=1,k=0;

cout<<"welcome !\n\n";

cout<<"this is quiz in the sum\n\n";

cout<<"enter the number of qustions you need : ";

cin>>n;

cout<<endl;

cout<<"you need: ("<<n<<") qustion!\n"<<endl;

cout<<"you must select the range of number that you need \n"<<endl;

cout<<"enter the start range : ";

cin>>a;

cout<<"\nenter the end range : ";

cin>>b;

cout<<"\nyour number bettwen ("<<a<<") and ("<<b<<") "<<endl;

for(int m=1;m<=n;m++)

{

srand(l);

r=rand()%b+a;

srand(k);

t=rand()%b+a;

sum=r+t;

cout<<"\n\tQ"<<m<<") "<<r<<" + "<<t<<" = ";

cin>>s;

if(sum==s)

{

cout<<endl;

cout<<"\n\tExcellent\a\a"<<endl;

}

else

{

cout<<endl;

cout<<"\n\terror tray again\a\a"<<endl;

e++;

}

l++;

k++;

if(e==3)

break;

else

continue;

}

if(e==3)

cout<<"\n\t\tyou must study hard\n\n\a\a\a\a";

else

cout<<"\n\t\tyou are very good\n\n\a\a\a\a";

}

MAIN.CPP

hackers.jpg
#2

قد لا اكون من هواة الرياضيات لكن اطلب منك ان تنسق الموضوع بشكل افضل حتى يسهل قرائة الكود

#3
#include<iostream.h>
#include<cstdlib>
void main()
{
	int n,a,b,r,t,sum,s,e=0;
	unsigned int l=1,k=0;
	cout<<"welcome !\n\n";
	cout<<"this is quiz in the sum\n\n";
	cout<<"enter the number of qustions you need : ";
	cin>>n;
	cout<<endl;
	cout<<"you need: ("<<n<<") qustion!\n"<<endl;
	cout<<"you must select the range of number that you need \n"<<endl;
	cout<<"enter the start range : ";
	cin>>a;
	cout<<"\nenter the end range : ";
	cin>>b;
	cout<<"\nyour number bettwen ("<<a<<") and ("<<b<<") "<<endl;


		for(int m=1;m<=n;m++)
	{
		srand(l);
			r=rand()%b+a;
		srand(k);
			t=rand()%b+a;
		sum=r+t;
		cout<<"\n\tQ"<<m<<")  "<<r<<" + "<<t<<" = ";
		cin>>s;
		if(sum==s)
		{
			cout<<endl;
			cout<<"\n\tExcellent\a\a"<<endl;
		}
		else
		{
			cout<<endl;
			cout<<"\n\terror tray again\a\a"<<endl;
			e++;

		}
		l++;
		k++;
		if(e==3)
			break;
		else
			continue;

	}
	if(e==3)
	cout<<"\n\t\tyou must study hard\n\n\a\a\a\a";
		else
	cout<<"\n\t\tyou are very good\n\n\a\a\a\a";
}
#4

شكرا اخي PointerVC انك رتبت الكود وبحكي لل allko انه في ملف مرفق للعبة جربه يمكن تعشق الرياضيات.

hackers.jpg

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

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

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

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

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

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