Algoritmalar ve Programlama – 1 (Güz-2017) Hafta – 12 – 4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#include <iostream> #include <cstring> using namespace std; int main() { char kelime[500]; cout<<"Kelime Girin:"; cin>>kelime; int sayi=strlen(kelime); cout<<"Kelime:"<<kelime<<" Sayi:"<<sayi<<endl; cout<<"Kelimenin Tersi:"; /*for(int i=0;i<sayi;i++) { int indis=sayi-i-1; cout<<kelime[indis]; }*/ for(int i=sayi-1;i>=0;i--) cout<<kelime[i]; return 0; } |
Okumaya devam et
Son Yorumlar