+ 4

Anybody please help me to solve this extra terrestials code challenge My code below is failing in 2test cases

https://code.sololearn.com/c00l0UyShSxG/?ref=app

6th Apr 2020, 11:33 AM
Addaganti Naga Sai Rajeev
Addaganti Naga Sai Rajeev - avatar
2 odpowiedzi
+ 1
#include<iostream> using namespace std; int main(){ char *h=new char; char *g=new char[40]; cin>>h; int sum=0; int tr=1; for(int w=0;w<=40;w++){ for(char k='a';k<='z';k++){ if(*(h+w)==k){ sum+=tr; } else{ continue; } } } sum-=1; for(int r=0;r<=sum;sum--) { cout<<*(h+sum); } }
7th Apr 2020, 6:53 PM
Zeynalow Azim
Zeynalow Azim - avatar
+ 3
Thanks but I want that in C Language
7th Apr 2020, 7:00 PM
Addaganti Naga Sai Rajeev
Addaganti Naga Sai Rajeev - avatar