Guest User

Untitled

a guest
Jan 27th, 2017
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. //Napisz program, który wczyta łańcuch znaków z klawiatury
  2. //a następnie usunie z tego łańcucha pierwszą małą literę.
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <conio.h>
  7. #include <string>
  8.  
  9. using namespace std;
  10.  
  11.  
  12.  
  13. void func(char tab[])
  14. {
  15.     int i = 0;
  16.     while (!tab[i]>='a' && !tab[i]<='z')
  17.         i++;
  18.     if (tab[i]>='a' && tab[i]<='z')
  19.         strcpy(&tab[i], &tab[i + 1]);
  20. }
  21.  
  22.  
  23. int main()
  24. {
  25.     char text[50];
  26.     cout << "Podaj swoj tekst" << endl;
  27.     cin.getline(text, 50);
  28.     func(text);
  29.     cout << text;
  30.     _getch();
  31. }
Advertisement
Add Comment
Please, Sign In to add comment