Posts

Showing posts with the label Char Sum

HackerEarth's basic programming solutions( Life the Universe and Everything, Ladderophilia, Char Sum ) :

Problem 30: Life, the Universe, and Everything Solution: (in c++) ( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder) #include< bits/stdc++.h > using namespace std ; int main () {      int n ;      while ( n != 42 )      {         cin >> n ;          if ( n != 42 )         cout << n << endl ;      }      } This code is simple. There's no need for any explanation.         Problem 31:  Ladderophilia Solution: (in c++) ( please guys before moving to the solution try it yourself at least 3-4 times , if you really wanna become a good coder) #include< bits/stdc++.h > using namespace std ; int main () { int n ; cin >> n ; cout << "* *" << endl ; for ( int i = 0 ; i < n ; i ++) {    cout << "* *" << endl ;    cout << "*****" << endl ;    cout << "