0
Need Help!
#include <iostream> using namespace std; int main() { string a,z; cin>>a; int p= a.length(); for(int y=p-1 ;y==0;y--){ for(int i=0;i<p;i++){ z[i]=a[y]; } } cout<<z; return 0; } Why is this code giving no output?
3 ответов
+ 1
First mistake is putting y==0 which won't run the loop
+ 2
It should be char z[20] instead of string z;
0
ya i changed that but its still not working