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

[مخالف]ارجو المساعده في تفكيك شفرات برنامجي ..

مغلق
بدأه رونق الامل في 23 أبريل 2012 · 4 رد · 241 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

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

ارجو من حضراتكم مساعدتي في حل برنامج بلغة ال ++c

حيث ان موعد تسليم المشروع قد قرب و لم اتوصل للحل الصحيح

داعيه الله ان ييسر و يسهل على من سهل علي

البرنامج الاول :

Description

The game of Nubble is a very popular game among math teachers in British elementary schools.

It is used as a fun way to teach basic arithmetic to kids. In this game, a player throws a set of

two or more dice (normally four, never more than six,) and tries to come up with an arithmetic

expression using all the values on the dice they got. Expressions are formed using the basic four

arithmetic operations: addition, subtraction, multiplication, and even division1. The challenge is

to get the largest possible value less than 100.

For example, imagine getting the four dice values: 2, 6, 3, and 1. One can make the expression

(6+3+2+1) = 12. But we can do better than that since (6 3 2+1) = 37. But the best value

you can get given these dice is 54 = 6 3 (1 + 2).

Write a program that takes a list of dice values and determines an arithmetic expression with the

largest value less than 100.

Input Format

Your program will be tested on one or more test cases. Each test case is specified on a single line

using the form:

n v1 v2 . . . vn

Where n is the number of dice, and v1 . . . vn are the dice values. The end of test cases is indicated

by the value zero on a separate line.

Output Format

For each test case, print the best value that can be achieved on a separate line.

البرنامج الثاني :

Description

A palindrome is a word that reads the same forward or backward. For example, “noon”, “civic”,

and “rotator” are all palindromes. We can extend the definition of palindromes to include integers

too. For example, “5”, “22”, and “10701” are all palindromes. As for negative integers, we’ll say

that a negative integer is a palindrome only if its positive counterpart is a palindrome.

Write a program that computes how many palindrome integers there are between any two given

integers.

Input Format

The input file is made of a number of test cases. Each test case specifies a range of integers using

a pair of integers <L,U> where −1, 000, 000 < L U < 1, 000, 000. Each test case is specified on

a separate line, with at least one space character between L and U.

The set of test cases ends with the pair <-1,-1>, which is not part of the test cases.

Output Format

For each test case <L,U>, your program should print how many palindromes there are within the

range L and U (inclusive).

البرنامج الثالث :

Description

For years, a group of Regional Contest Directors (RCDs) of the ACM International Collegiate

Programming Contest (ICPC) have been unsatisfied with the way contest submissions get ranked.

The group sees it is academically wrong to emphasize the importance of program correctness,

disregarding the “quality” of the program itself. After all, programming as a profession promotes

design, style, maintainability, etc. and not just correctness. The group’s suggestion is to have

a panel of six judges. Each judge is assigned the task of grading the submissions based on a

particular aspect: 1) Correctness; 2) Robustness; 3) Overall design; 4) Clarity; 5) Coding style;

and finally 6) Maintainability. The final grade of a submission would be the average of the six

grades it gets.

The old guards of the current ICPC judging style have always responded that it is not possible

to impartially judge a program on anything but correctness. How can the ICPC be certain that

judging is fair? In other words, how can the ICPC be sure that non of the judges is favoring certain

teams and disadvantaging others? Any hint of accusation to the judging process and ICPC loses

the prestigious status it worked on for years. (Alright! So they do have a point.) Still, this hasn’t

stopped other domains from judging candidates based on subjective metrics. Take for example

Gymnastics, or The Nobel Prizes, or even the ACM’s very own Doctoral Dissertation Award.

These are all highly respected awards where the winner is selected by judges using subjective

metrics. ICPC could use a new judging system based on what is used in gymnastics. Rather than

having each judge grade a certain aspect of the program, each of the six judges would assign an

overall grade (out of ten) based on all of the six metrics mentioned above. To enforce impartiality,

the final grade of a submission would be calculated as the average of all the grades after deleting

two grades: The highest and the lowest. Any judge that favors a certain team (and assigns them

an undeserved high grade,) risks the possibility of that grade being dismissed. Similarly, any

judge that attempts to disadvantage a team by assigning them a low grade faces a similar risk.

Write a program to print the final grade of a submission.

Input Format

Your program will be tested on one or more test cases. Each test case is described on a single

input line listing the grades of the judges. The end of the test cases is identified with a dummy

test case with all the grades being zero.

Output Format

For each test case, print the grade on a separate line (without unnecessary decimal points and/or

zeros.)

ارجو سرعه الرد ..

جزيتم خيراً

تم تعديل هذه المشاركة بواسطة رونق الامل في 23 أبريل 2012 في 14:34

#2
اقتباس

و لم اتوصل للحل الصحيح

واين الحل الخطأ لنساعدك فيه ؟

1 −1


﴿وَمَا كَانَ اللَّهُ لِيُعَذِّبَهُمْ وَأَنْتَ فِيهِمْ ۚ وَمَا كَانَ اللَّهُ مُعَذِّبَهُمْ وَهُمْ يَسْتَغْفِرُونَ﴾

الأنفال ۳۳                                  
 

#3

البرنامج الاول :

Description

The game of Nubble is a very popular game among math teachers in British elementary schools.

It is used as a fun way to teach basic arithmetic to kids. In this game, a player throws a set of

two or more dice (normally four, never more than six,) and tries to come up with an arithmetic

expression using all the values on the dice they got. Expressions are formed using the basic four

arithmetic operations: addition, subtraction, multiplication, and even division1. The challenge is

to get the largest possible value less than 100.

For example, imagine getting the four dice values: 2, 6, 3, and 1. One can make the expression

(6+3+2+1) = 12. But we can do better than that since (6 3 2+1) = 37. But the best value

you can get given these dice is 54 = 6 3 (1 + 2).

Write a program that takes a list of dice values and determines an arithmetic expression with the

largest value less than 100.

Input Format

Your program will be tested on one or more test cases. Each test case is specified on a single line

using the form:

n v1 v2 . . . vn

Where n is the number of dice, and v1 . . . vn are the dice values. The end of test cases is indicated

by the value zero on a separate line.

Output Format

For each test case, print the best value that can be achieved on a separate line.

الحل :

#include <iostream.h>

int main()

{

int x,y,z,d,s,f,r,max;

cin>>x,y,z,d;

s=(x*y*z+d);

f=x+y+z+d;

r=x*y*(z+d);

if (f>s)

{

if(f>r)

{

max=f;

cout<<f;

}

}

if (r>s)

{

if (r>f)

{

max=r;

cout<<r;

}

}

if (s>r)

{

if (s>f)

{

max=s;

cout<<s;

}

}

return 0 ;

}

و طبعا من نزلت الحل من الاول لاني عارفه و متأكده ان الحل غلط ..

و اتوقع اني ما فهمت السؤال تمام

#4

البرنامج الثاني :

Description

A palindrome is a word that reads the same forward or backward. For example, “noon”, “civic”,

and “rotator” are all palindromes. We can extend the definition of palindromes to include integers

too. For example, “5”, “22”, and “10701” are all palindromes. As for negative integers, we’ll say

that a negative integer is a palindrome only if its positive counterpart is a palindrome.

Write a program that computes how many palindrome integers there are between any two given

integers.

Input Format

The input file is made of a number of test cases. Each test case specifies a range of integers using

a pair of integers <L,U> where −1, 000, 000 < L U < 1, 000, 000. Each test case is specified on

a separate line, with at least one space character between L and U.

The set of test cases ends with the pair <-1,-1>, which is not part of the test cases.

Output Format

For each test case <L,U>, your program should print how many palindromes there are within the

range L and U (inclusive).

مشكلتي في هذا البرنامج اني استطيع تحديد الارقام المتناظره و لكن البرنامج يطلب من المستخدم ادخال الارقام و المطلبو من السؤال ان الارقام الناتجه تكون من نتاج المقارنه و ليس من ادخال المستخدم

الحل :

#include<iostream.h>

int main()

{ int l,u,n,x=0, bol=0;

cout<<"enter the travil ";

cin>>l>>u;

cout<<"inter ther number of number ";

cin>>n;

if(n%2!=0)

for(int i=l;i<=u;i++)

{

if(n==3)

{

int a[3];

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

for(i=0;i<3;i++)

if(a!= a[3-i-1])

bol=1;

if(bol==0)

cout<<"symmetric";

else

cout<<" no ";

}

else if(n==5)

{

int a[5];

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

if(a!= a[5-i-1])

bol=1;

if(bol==0){

x=x+1;

cout<<"x="<<x;

}

}

else if(n==7)

{

int a[7];

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

for(i=0;i<7;i++)

if(a!= a[7-i-1])

bol=1;

if(bol==0)

cout<<"symmetric";

else

cout<<" no ";

}

}

else

cout<<"eroo";

return 0;

}

تم تعديل هذه المشاركة بواسطة رونق الامل في 23 أبريل 2012 في 14:41

#5

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

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

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

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

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

/index.php?showtopic=29343

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

{username}

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

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

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

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

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

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

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