Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Napisz program, który wczyta łańcuch znaków z klawiatury
- //a następnie usunie z tego łańcucha pierwszą małą literę.
- #include "stdafx.h"
- #include <iostream>
- #include <conio.h>
- #include <string>
- using namespace std;
- void func(char tab[])
- {
- int i = 0;
- while (!tab[i]>='a' && !tab[i]<='z')
- i++;
- if (tab[i]>='a' && tab[i]<='z')
- strcpy(&tab[i], &tab[i + 1]);
- }
- int main()
- {
- char text[50];
- cout << "Podaj swoj tekst" << endl;
- cin.getline(text, 50);
- func(text);
- cout << text;
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment