معکوس کردن رشته
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<iostream.h>
#define EOLN '\n'
/*read a line of text and write it out backwards, using recursion */
void main(){
void reverse(void);
cout<<" please enter a line of text belown "<<'\n';
reverse();
}
void reverse (void)
{
char c;
if ((c=getchar()) != EOLN) reverse();
putchar(c);
return;
}
+ نوشته شده در شنبه ۱۳۸۵/۰۴/۱۰ ساعت 7:10 توسط باران
|