عيون النرجس2
Well-Known Member
- تاريخ التسجيل
- 8 ديسمبر 2011
- المشاركات
- 85
- المجموعة
- أنثى
- الدفعة الدراسية
- 2011
- الكلية
- كلية تقنية المعلومات
- التخصص
- IS
Write a recursive function named printCountStr that accepts as parameters: a string str, and the string size. The function should print the characters of str in reverse order without spaces and return the total number of spaces found in str. The function prototype is:
int printCountStr (string str, int size);
For example:
If str = “My Cs Exam”, and size=10.
Then the function should return 2 (i.e. two spaces found)
And output the following: maxEsCyM
ممكن أحد يساعدني بالحل؟
int printCountStr (string str, int size);
For example:
If str = “My Cs Exam”, and size=10.
Then the function should return 2 (i.e. two spaces found)
And output the following: maxEsCyM
PHP:
int print(string str , int size)
{
for(int i=0; i<size ; i++)
if(i == " ")
i--;
return 1 + print(str,size-1);
else
return -1;
}
int main()
{
print(str ,size);
cout<<print(My Cs Exam ,10)
system("pause");
return 0;
}
ممكن أحد يساعدني بالحل؟
خلصناااا 



