ورود

View Full Version : سوال: تورو خدا کمکم کنید



zahrajuni
سه شنبه 11 اسفند 1394, 09:40 صبح
دوستان سوال برنامه نویسی دارم با زبان cیا جاوا خواهش میکنم بهم جواب بدید خیلی مهمه اگه ننویسم نمره نمیگیرم :ناراحت::ناراحت:

We want to create a musical score consisting of a succession of notes. There are only two choices for the pitch of eachnote: each note has either a low sound or a high sound. There are also only two choices for the duration of each note:each note is either short or long. Each short note takes 1 second, and each long note takes 2 seconds. We have thefollowing constraints:a) The total duration of the musical score should be a given integer 𝑛𝑛.b) The number of low short notes should be the same as the number of high short notes.c) The number of low long notes should be the same as the number of high long notes.d) There should be at least as many long notes as there are short notes.e) Low and high notes must alternate.f) The first note should be low.Given an even integer 𝑛𝑛, we want to know the number of possible music scores satisfying the above.For example, with 𝑛𝑛 = 6, there are 4 possibilities:2211, 2112, 1221, 1122(Each note is represented by its duration, and the high notes are shown in bold.)With 𝑛𝑛 = 8, there is only 1 possibility: 2222Input (Standard Input)The first line of the input includes the number of test cases 𝑡𝑡0T, 1 ≤ 𝑡𝑡 ≤ 10000. On each next line, a test case is specifiedby giving the even integer 𝑛𝑛, 2 ≤ 𝑛𝑛 ≤ 100.Output (Standard Output)For each test case, print one line containing the answer to the question

محمد فدوی
پنج شنبه 13 اسفند 1394, 17:05 عصر
اگه می‌خواید جواب بگیرید، اولا عنوان مناسبی برای موضوع انتخاب کنید. «کمک!» و «فوری! کمک کنید» و امثالهم فقط باعث می‌شه دیرتر جواب بگیرید و ثانیا متن پروژه رو فارسی و با توضیحات کامل بنویسید. :)