Advertisement
Talar97

[JPO] Adrian kolokwium, zad 1

Jun 3rd, 2018
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. string usunMalaLitere(string lancuch){
  7.     string wynik;
  8.     bool czyUsunieto = false;
  9.     for(int i = 0; i < lancuch.length(); i++){
  10.         if(lancuch[i] >= 'a' && lancuch[i] <= 'z' && !czyUsunieto){ czyUsunieto = true; }
  11.         else{
  12.             wynik += lancuch[i];
  13.         }
  14.     }
  15.    
  16.     return wynik;
  17. }
  18.  
  19. int main() {
  20.     string lancuch;
  21.     cout << "Podaj lancuch: ";
  22.     cin >> lancuch;
  23.    
  24.     string nowy = usunMalaLitere(lancuch);
  25.     cout << nowy;
  26.    
  27.     return EXIT_SUCCESS;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement