Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <cstring>
- using namespace std;
- int main()
- {
- int n;
- cout << "enter n: " << endl;
- cin >> n;
- char str1[100];
- char a[100][100];
- for (int i = 0; i <= n; i++)
- {
- cin.getline(str1, 100);
- for (int j = 0; j < strlen(str1); j++)
- {
- a[i][j] = str1[j];
- }
- }
- for (int i = n; i > 0; i--)
- {
- bool hasOnlySmallLetters = true;
- for (int j = 0; str1[j]; j++)
- {
- if (a[i][j] < 'a' || a[i][j] > 'z')
- {
- hasOnlySmallLetters = false;
- }
- }
- if (hasOnlySmallLetters)
- {
- for (int j = 0; str1[j]; j++)
- {
- cout << a[i][j];
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement